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? Link to comment https://forums.phpfreaks.com/topic/127695-solved-bhad/ 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 Link to comment https://forums.phpfreaks.com/topic/127695-solved-bhad/#findComment-660842 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. Link to comment https://forums.phpfreaks.com/topic/127695-solved-bhad/#findComment-660843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.