View Single Post
  #1 (permalink)  
Old 07-18-05, 06:17 PM
jasonweaver jasonweaver is offline
New Member
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Need Help Searching SQL database with PHP

I have a database set up with one table called Number. I am trying to query the database with a search button to display the searched results. In my code I have connected to my database but I am having trouble to display any results that are searched. Here is the code I am using after I connect:

$SQL = "SELECT * FROM Number WHERE Number LIKE '%$box%' LIMIT 10";


$result = mysql_query($SQL) or die(mysql_error("Error in query"));


while($row = mysql_fetch_array($result))
{
echo $row['Number'];
}

?>

If anyone has any better code or know how to add this search feature to my site that would be great. Thanks
Reply With Quote