markjaysontimbol
New member
<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","po.php?q="+str,true);
xmlhttp.send();
}
</script>
<?php
$q = $_GET['q'];
$sql="SELECT * FROM tbl_product WHERE productCode = '".$q."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
echo "<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>SRP</th>
<th>Quantity Ordered</th>
<th>Total Amount</th>
</tr>";
do{
echo "<tr>";
echo "<td>" . $row['productName'] . "</td>";
echo "<td>" . $row['price'] . "</td>";
echo "<td>" . $row['srp'] . "</td>";
echo "<td>" . $row['optimumLevel'] . "</td>";
echo "<td>" . $getQa['totalAmount'] . "</td>";
echo "</tr>";
}while($row = mysql_fetch_assoc($result));
echo "</table>";
The error is: Undefined index: q
Please Help
the variable $q is the one that I want to search for.
And I don't have any page that contains the variable of q just like what you said, index.php?q=123456. Please help.
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","po.php?q="+str,true);
xmlhttp.send();
}
</script>
<?php
$q = $_GET['q'];
$sql="SELECT * FROM tbl_product WHERE productCode = '".$q."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
echo "<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>SRP</th>
<th>Quantity Ordered</th>
<th>Total Amount</th>
</tr>";
do{
echo "<tr>";
echo "<td>" . $row['productName'] . "</td>";
echo "<td>" . $row['price'] . "</td>";
echo "<td>" . $row['srp'] . "</td>";
echo "<td>" . $row['optimumLevel'] . "</td>";
echo "<td>" . $getQa['totalAmount'] . "</td>";
echo "</tr>";
}while($row = mysql_fetch_assoc($result));
echo "</table>";
The error is: Undefined index: q
Please Help
the variable $q is the one that I want to search for.
And I don't have any page that contains the variable of q just like what you said, index.php?q=123456. Please help.