Hi friends i m new to php and mysql and i want to execute a query where it has to search in 4 columns of "common" table(common is a table name). where we will be having only one textbox at the front end and its name="refno"
= mysql_connect(= ""= ""= $_POST[= explode(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>abc</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
</script>
<style>
.ddtbl{
width:100%;
border-collapse:collapse;
}
.ddtbl td{
border:1px solid red;
}
.ddtbl th{
border:1px solid red;
}
</style>
</head>
<body>
<div class="main">
<div class="page">
<div class="header">
<div class="banner">
<h1><a href ="userform.php"> <img src="images/abc.png" width="100"alt="abc" align="absmiddle"/>abc</a></h1>
</div>
</div>
<div class="content">
<div class="content-in">
<div class="gap"></div>
<div class="right-panel" style="border:1px solid red;">
<div style="position:relative;overflow:hidden;width:100%;border:1px solid blue;min-height:200px;">
<form action="fetchdata.php" method="post">
<table style="width:100%;">
<tr>
<td>
<div class="reg_form_row">
<div class="reg_form_row_left">Enter RefNo. or Agent Name or abc No. or Caller Id</div>
<div class="reg_form_row_right"><input name="refno" style="width: 150px;" maxlength="100" value="<?php echo $refid; ?>" /></div>
</div>
</td>
</tr>
</table>
<input name="submit1" type="submit" value="Get Info" />
</form>
</div>
</div>
=""= "select * from common where refno='$refid'"= "select * from common where agentname='$refid'"= "select * from common where zcno='$refid'"= "select * from common where callerid='$refid'"= mysql_query($strquery);
<table class="ddtbl">
<tr>
<th>Results for Refno entry</th>
</tr>
</table>
<table class="ddtbl">
<tr>
<th>refno</th>
<th>date</th>
<th>agentname</th>
<th>zcno</th>
<th>callerid</th>
</tr>
= mysql_fetch_array($result))
= $data[= $data[= $data[= $data[= $data[
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<br /><br />");
}
$result1 = mysql_query($strquery1);
?>
</body>
</html>