Lippy
12-02-2002, 01:51 AM
I am getting errors in the following lines. Any help would be greatly appreciated.
$row = mysql_fetch_array($result);
if(mysql_num_rows($result) >0)
Here is the full php block.
<?
// Start "leftside news"
$query4 = "SELECT *, time AS timeorder, date_format(time, '%Y-%m-%d') AS today, date_format(time, '%a %c-%d-%Y %T')
AS time FROM reviews ORDER BY timeorder DESC LIMIT 3, $numsideitems";
$result = mysql_query($query4);
if (!$result)
{
echo( "Unable to locate the query results at this time." );
}
$row = mysql_fetch_array($result);
if(mysql_num_rows($result) >0)
{
do
{
$query5 = "SELECT * FROM authors WHERE id = '" . $row["author"] . "'";
$result2 = mysql_query($query5);
$row2 = mysql_fetch_array($result2);
echo("<a href=\"reviews.php?id=" . $row["id"] . "\">" . $row["title"] . "</a><BR><BR>");
}while( $row = mysql_fetch_array($result) );
}
?>
$row = mysql_fetch_array($result);
if(mysql_num_rows($result) >0)
Here is the full php block.
<?
// Start "leftside news"
$query4 = "SELECT *, time AS timeorder, date_format(time, '%Y-%m-%d') AS today, date_format(time, '%a %c-%d-%Y %T')
AS time FROM reviews ORDER BY timeorder DESC LIMIT 3, $numsideitems";
$result = mysql_query($query4);
if (!$result)
{
echo( "Unable to locate the query results at this time." );
}
$row = mysql_fetch_array($result);
if(mysql_num_rows($result) >0)
{
do
{
$query5 = "SELECT * FROM authors WHERE id = '" . $row["author"] . "'";
$result2 = mysql_query($query5);
$row2 = mysql_fetch_array($result2);
echo("<a href=\"reviews.php?id=" . $row["id"] . "\">" . $row["title"] . "</a><BR><BR>");
}while( $row = mysql_fetch_array($result) );
}
?>
