View Single Post
  #4 (permalink)  
Old February 18th, 2012, 07:27 AM
UseLess UseLess is offline
Friend of Wrox
Points: 651, Level: 9
Points: 651, Level: 9 Points: 651, Level: 9 Points: 651, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Location: North East UK
Posts: 125
Thanks: 0
Thanked 24 Times in 24 Posts
Default

Greetings,

In your example above you're using this;
Code:
$result = mysql_fetch_array($result)
if ( mysql_num_rows($result)==0 && $result[0] = ' ')
So assuming you're putting the result of the query into $result you cannot then use;
Code:
$result = mysql_fetch_array($result);
as you have just destroyed the variable holding the db pointer to the query result. So if there is more than one row to be returned from the db you won't get them as you have just destroyed the only way to access them.

Therefore in this case the result of the 'mysql_num_rows' call could be meaningless due to destroying the valid db pointer and turning it into an array instead.

So basically get the result of the query into a variable and then each row from the db into another variable....

Last edited by UseLess; February 18th, 2012 at 07:35 AM..
Reply With Quote
The Following User Says Thank You to UseLess For This Useful Post:
gkman (February 18th, 2012)