By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,044 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,044 IT Pros & Developers. It's quick & easy.

another simple question.

P: n/a
select from db where id = 3...

if it doesn't exist, how can i display a message saying so.

for example:

"3" is not a valid selection.

make sense?
thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Trevor Kearsey wrote:

select from db where id = 3...

if it doesn't exist, how can i display a message saying so.

for example:

"3" is not a valid selection.


$res = mysql_query("select from db where id = 3");
if (!$res)
echo "ERROR" . mysql_error();
elseif (mysql_num_rows($res) == 0)
echo "No results from search";
else
echo "Results were returned from search.";

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.