unkwntech Posted October 9, 2008 Share Posted October 9, 2008 BHAD - Beating Head Against Desk So for round 2 tonight, I have the following code: $result = mysql_query($sql, $link) or die('oops'); if(mysql_num_rows($result) < 1) { echo mysql_num_rows($result); echo "False;NULL;NULL"; } else { echo mysql_num_rows($result); echo 'True;' . mysql_result($result, '0', 'version') . ';' . mysql_result($result, '0', 'fileLocation'); } which is outputting: 1True;0.1 (0001);path/to/file.ext the problem is that if mysql_num_rows($result) is 1 then it should be outputting False;NULL;NULL WTF? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 9, 2008 Share Posted October 9, 2008 If you want that result change the if statement to <?php if(mysql_num_rows($result) < 2) ?> Right now, the script will only output the FALSE condition when mysql_num_rows() returns a 0 (zero). Ken Quote Link to comment Share on other sites More sharing options...
unkwntech Posted October 9, 2008 Author Share Posted October 9, 2008 Damnit all, it was a logic issue in my SQL, statement but thanks your answer helped me realize what was wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.