View Single Post
Old Mar 26th, 2008, 2:39 PM   #7
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,603
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
Re: Simple PHP Search Script

Ok, so atleast now you know there is a problem when sending your query. might want to check your SQL statement.

Change this:
php Syntax (Toggle Plain Text)
  1. #
  2. //Now we search for our search term, in the field the user specified
  3. #
  4. $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'");
to:
php Syntax (Toggle Plain Text)
  1. //Now we search for our search term, in the field the user specified
  2. $sql = "SELECT * FROM users WHERE upper($field) LIKE'%$find%'";
  3. echo $sql;
  4. $data = mysql_query($sql) or die(mysql_error());

This way you can see exactly what is being sent to the database.
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is online now   Reply With Quote