i want skip 1 record mysql using php when record match variable value.
the $row['uni_id'] id in row of database table , $_session['uid'] stores id in session. when ids match, record should skipped. it's not working. see issue?
while($row = mysql_fetch_array($res,mysql_assoc )){ if ($row['uni_id'] == $_session['uid']){ continue; } $_session['new_img']=$row['pic_add'];enter code here $image= $row['pic_add']; echo "<tr><td>"; echo "{$row['fname']} {$row['lname']}"; echo "</td><td>"; echo $row['street']; echo "</td><td>"; echo $row['city']; echo "</td><td>"; } mysql_free_result($res);
can try below code ?
<?php while($row = mysql_fetch_array($res,mysql_assoc )){ if ($row['uni_id'] != $_session['uid']){ $_session['new_img'] = $row['pic_add']; $image= $row['pic_add']; echo "<tr><td>"; echo "{$row['fname']} {$row['lname']}"; echo "</td><td>"; echo $row['street']; echo "</td><td>"; echo $row['city']; echo "</td><td>"; } } mysql_free_result($res); ?>
Comments
Post a Comment