PHP if with fetch from Mysql DB -
i can't head around why wont work..
<? (connect info , select db etc here) $term = $_post['term']; $sql = mysql_query("select * evansu username '%$term%'"); if ($row==$term) { while ($row = mysql_fetch_array($sql)) echo 'id: '.$row['id']; echo '<br/> first name: '.$row['username']; echo '<br/> last name: '.$row['name']; echo '<br/> phone: '.$row['phone']; echo '<br/><br/>'; } else echo "nothing found, have nice day!";
?>
it says nothing found if value in db, , if remove if code works , shows info. help?
$row==$term
false
if $_post['term']
not empty. leads while
loop not being executed.
Comments
Post a Comment