Unable to jump to row 0
I have strange problem, after renamed (and updated on query) MySQL tables
when I perform search I receive this warning:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0
on MySQL result index 8 in D:\dev\search.php on line 94
Here my code:
$query = "SELECT * FROM admin WHERE ((`status_desc` LIKE '%".$search."%')
OR ('%".$search."%')) LIMIT 100";
$result = mysql_query($query) or die(mysql_error());
$num = mysql_numrows($result);
Line 94 is $status_id:
<?php
$i=0;
while ($i < $num)
{
$status_id = mysql_result($result,$i,"status_id");
$status_des = mysql_result($result,$i,"status_desc");
?>
<tr>
<td><a href="config_status_edit.php?status_id=<?php echo $status_id;
?>"><?php echo $status_id; ?></a></td>
<td><?php echo $status_desc; ?></td>
</tr>
<?php
$i++;
}
?>
What's wrong? (I have planned update to PDO but at moment I need to use
mysql_query)
No comments:
Post a Comment