Unable to jump to row 0 on MySQL result

Hey there, thank you so much for your help. I love this forum as you guys are very helpful. My issue is with the segment of code below and I cannot get it to work and have tried everything I can think of and even google the issue. Please tell me how to correct this error. Thank you so much!

Unable to jump to row 0 on MySQL result is the error:

            $get_sel_id= "select master_id from master_family where family_id = $_POST[fam_id]";
$sel_id= mysql_query($get_sel_id);

$num=mysql_num_rows($sel_id);
$i=0;
while ($i < $num) {

$get_master = "select concat_ws(' ', f_name, l_name) as display_name
	from master_name where id= '$sel_id'";
$get_master_res = mysql_query($get_master);
$display_name = stripslashes(mysql_result($get_master_res, 0, 'display_name'));

$display_block = "<h1>Showing Record for $display_name</h1>";

Thank you so much for your help!!!

Hi there,

Try replacing the 0 with $i (line that sets $display_name) and you might also want an $i++ and a closing } for the loop if that’s your full code.

thank you for your reply. Unfortunately it did not work. It seemed like a great suggestion. I did have the $i++ } in my code further down but I only posted the section giving me the issue. Please let me know what else I can try to get this code to work. Thank you so much!

Sponsor our Newsletter | Privacy Policy | Terms of Service