checking if a MySQL record exists
Moderator: General Moderators
checking if a MySQL record exists
how can you check if a record exists, just post the query and it will be greatly appreciated
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Code: Select all
$result = mysql_query("SELECT * FROM tablename WHERE <conditions>");
$num_results = mysql_num_rows($result);
if( $num_results == 0 )
echo "No results found";
else
echo "Results found";ok thx
thanx a lot. sry for askin yall all these questions, when i finish my script, ill give it 2 yall.