Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

test if a db query gets "hit's" 3

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
Newbie ques.

I want to be able to test if a db query gets "hit's" or not, so eg,
$query = SELECT * from table...
$result = mysql_query($query)...

Now I assume I would test at some point with:
mysql_num_rows...to see if anything was returned,

Could anyone supply a snippet to show me how?
Thanks

 
If you are not interested in the actual results, then it would be much less resource intensive on the server to do "select count(*) from table where ..." and check the resulting count. Otherwise the server will allocate memory to start returning all those rows that matched.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top