Search system, (Noob)

Status
Not open for further replies.

Exilo

Member
Apr 27, 2012
192
5
Well, hello guys.
I am trying to just try to make a search system for my website.

I've followed this tutorial:

And ended up with this code:

PHP:
<?php
mysql_connect ("localhost", "*****","******")  or die (mysql_error());
mysql_select_db ("*****");
 
$term = $_POST['term'];
 
 $sql = mysql_query("select * from testtable where FName like '%$term%'");
 
while ($row = mysql_fetch_array($sql)){
    echo 'reported: '.$row['reported'];
    }
 
?>

However, I am getting "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/exilo385/public_html/adminpanel/search.php on line 9"

Now, I'm new with this, and I've tried to edit in line 9, but still not working.

Anyone have some help? Just so you guys can show me what's wrong?

Trying to search in "reported":
oIk89.png
 
Status
Not open for further replies.

Users who are viewing this thread

Top