acctman Posted April 8, 2009 Share Posted April 8, 2009 I know what the problem is, the is not picture record, but how do I suppress/skip this error $en['i_id'] = mysql_result(mysql_query("SELECT i_id FROM rate_pictures WHERE i_status='2' AND i_user='".$en[msg_sender]."'"), 0, "i_id"); Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/ Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 Put an @ symbol in front of "mysql_result". If you want to suppress the error why don't you just take out the entire line? Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/#findComment-804687 Share on other sites More sharing options...
acctman Posted April 8, 2009 Author Share Posted April 8, 2009 Put an @ symbol in front of "mysql_result". If you want to suppress the error why don't you just take out the entire line? its looping though, so i'd like for it to just bypass the records with no images but display all the other ones. i read somewhere about using mysql_num_rows() to check and display only rows with data. but i'm not sure how to apply that Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/#findComment-804694 Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 You can just do: if($en['i_id'] = mysql_result(mysql_query("SELECT i_id FROM rate_pictures WHERE i_status='2' AND i_user='".$en[msg_sender]."'"), 0, "i_id")) { // Proceed } else { // Invalid } Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/#findComment-804707 Share on other sites More sharing options...
acctman Posted April 8, 2009 Author Share Posted April 8, 2009 You can just do: if($en['i_id'] = mysql_result(mysql_query("SELECT i_id FROM rate_pictures WHERE i_status='2' AND i_user='".$en[msg_sender]."'"), 0, "i_id")) { // Proceed } else { // Invalid } last question is it bad to escape out non-errors with the @ sign? Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/#findComment-804739 Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 last question is it bad to escape out non-errors with the @ sign? It's good to suppress errors on a production server, but when you're trying to debug then you want to see these errors so you can fix them. Quote Link to comment https://forums.phpfreaks.com/topic/153184-unable-to-jump-to-row-0-on-mysql-result/#findComment-804741 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.