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"); 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? 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 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 } 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? 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. 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
Archived
This topic is now archived and is closed to further replies.