<?php
echo "<table border=\"1\">";
$query = mysql_query("SELECT * FROM news ORDER BY news_id") or die(mysql_error());
$total_results= mysql_num_rows($query);
if ($total_results >0){
echo "<tr><td>News ID</td><td>News Title</td><td>News Content</td><td>News Picture</td><td>News Date</td></tr>";
for($i = 0; $i < mysql_num_rows($query); $i++)
$a = mysql_result($query, $i, 'news_id');
$b= mysql_result($query,$i,'news_title');
$c= mysql_result($query,$i,'news_content');
$d = mysql_result($query, $i, 'news_pic');
$e = mysql_result($query, $i, 'news_date');
echo '<tr><td>'.$a.'</td><td>'.$b.'</td><td>'.$c.'</td><td>'.$d.'</td><td>'.$e.'</td><td><a href="editnews.php?action=edit&id='.$a.'">edit</a></td><td><a href="editnews.php?action=delete&id='.$a.'">delete</a></td>';
}else{
echo "<div style='position:absolute;left:420px;font-size:50px;'>No News created!</div>";
}
echo "</table>";
it shows this kind of error
arning: mysql_result() [function.mysql-result]: Unable to jump to row 2 on MySQL result index 6 in C:\xampp\htdocs\caps\editnews.php on line 82 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 2 on MySQL result index 6 in C:\xampp\htdocs\caps\editnews.php on line 83 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 2 on MySQL result index 6 in C:\xampp\htdocs\caps\editnews.php on line 84 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 2 on MySQL result index 6 in C:\xampp\htdocs\caps\editnews.php on line 85
i paste the lines where i get errors.
p.s
or error from the misplacing of my if statement and its brackets
This post has been edited by Syfer: 08 November 2011 - 06:14 AM

New Topic/Question
Reply




MultiQuote






|