rc69, on Oct 6 2005, 10:00 PM, said:
And miller's code won't work, it'd be more like:
mysql_query("SELECT * FROM users WHERE email LIKE '%$search%' OR foo = 'bar'");
3 things:
1. Learn to pay more attention to what's actually wrote down, it may help you with life.
2. If you're going to add "or die()" after a mysql_query(), make it something usefull. Go look at 90% of the scripts out there that have something like that, they'll never have "die('random comment')", it'll most likely be "or die(mysql_error())". It'd help you and everybody else if you did that from now on.
3. Pay more attention to what has been wrote down, and look more closely at the code I gave. You have to many "WHERE"'s in your code. You can also check the
mysql manual for more info on the SELECT statement and other misc stuff.
$result = mysql_query("SELECT * FROM users WHERE user LIKE '%$search%' OR first LIKE '%$search%' OR last LIKE '%$search%' OR email LIKE '%$search%'") or die(mysql_error());
$num=mysql_numrows($result);
if(!$num){
die("Could not find any items with that name.");
}
--------
Sorry if i sound a bit aggitated, it's been a long day...