Dear Twey,
I have now tested and tested. I have code and it shows me all rows and columns.
First column (ID for article) shows correct link like: http://www.mywebsite/article.php?ID=1 (for first row) and ID=2 for second row)
Do you have any suggestions how to do that also other columns will have this link?
Code is the following for while:
PHP Code:
while (list($key, $value) = each($row))
{
$i++;
if(!($i%2))
echo "<td><b><a href='?order=$key'>$key</a></td>";
}
echo "</tr>";
$result=mysql_query($sqlQuery);
// Make rows for records
while($rec=mysql_fetch_array($result))
{
echo "<tr>";
for($i=0;$i<count($rec);$i++)
{
if($rec[$i])/*continue;*/
$query = "SELECT ID FROM news where ID = '$rec[$i]' ";
$s = mysql_query($query);
//echo(mysql_error($s));
$result2 = mysql_fetch_assoc($s);
$ID=$result2['ID'];
echo '<td><a href="article.php?id='.$ID.'"><B>'.$rec[$i].'</B></A></td>';
}
echo "</tr>";
}
echo "</table>";
}
Bookmarks