This bit of code:
<div class="left">
<h3>Fresh News:</h3>
<?php fresh_news();?>
<div class="left_box">
<img class="image" alt="Big Image" src ="images/bigimage.gif" >
<h2><?php print"$newtitle";?></h2>
<p><?php print"$newdesc";?></p>
<p>Added: <?php print"$newdate";?></p>
</div>
Produces this error:
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 5 in /home/trecollc/public_html/test/functions.php on line 17
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 5 in /home/trecollc/public_html/test/functions.php on line 18
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 5 in /home/trecollc/public_html/test/functions.php on line 19
This is the freshnews function:
function fresh_news() {
$query = "SELECT * FROM news";
$result = mysql_query($query);
$i = mysql_numrows($result);
$newdate = mysql_result($result,$i,"date");
$newtitle = mysql_result($result,$i,"title");
$newdesc = mysql_result($result,$i,"description");
}
Why do i get this error? There is definately a record as i use mysql_numrows but for some reason it wont display it
TIA
RT