|
-
Jul 6th, 2002, 05:41 AM
#1
Thread Starter
New Member
Searching a database
This code puts out what I search for fine:
$result = mysql_query("SELECT * FROM mytable WHERE id = $variable");
while($row = mysql_fetch_array($result)){
echo $row["id"];
echo "<br>";
echo $row["name"];
echo "<br>";
}
What I can't figure out is if there is no id $variable in the table, how do I get it to come back and:
echo "nothing found";
I'd guess its some sort of 'if' statement, but I don't know exactly how to construct it in this case.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|