i have this code, and when i run it, it always give me a error in
this line : while ($myrow = mysql_fetch_array($result)) ,
and i don't no why .
here it goe's the all code:
<HTML>
<?php
if ($searchstring)
{
$db = mysql_connect("localhost", "root", "");
mysql_select_db("learndb",$db);
$sql="SELECT * FROM personnel WHERE $searchtype LIKE '%$searchstring%' ORDER BY firstname ASC";
$result = mysql_query($sql,$db);
echo "<TABLE BORDER=2>";
echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Options</B></TR>";
while ($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>".$myrow["firstname"].$myrow["lastname"];
echo "<TD>".$myrow["nick"];
echo "<TD>"."<a href=\"ver.php?id=".$myrow["id"]."\">ver</a>";
}
echo "</TABLE>";
}
else
{
?>
<form method="POST" action="<?php $PHP_SELF ?>">
<table border="2" cellspacing="2">
<tr><td>Insert you search string here</td>
<td>Search type</td></tr>
<tr>
<td><input type="text" name="searchstring" size="28"></td>
<td><select size="1" name="searchtype">
<option selected value="firstname">First Name</option>
<option value="lastname">Last Name</option>
<option value="nick">Nick Name</option>
</select></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
</p>
</form>
<?php
}
?>
</HTML>
thank's for everything