Here is the full error message:
Fatal error: Call to undefined function: array() in /www/www.sailinganarchy.com/htdocs/classified/ad_display.php on line 40
Which is the line: while ($row = mysql_fetch_array($result, MYSQL_NUM)) from the code below. According to all the books I have it would work. I have one record in the table and the connectin seems to work so any thoughts would be great.
ad_display.php
<?
/*
$Ad = Null;
$msg = Null;
$id = 0;
$user = Null;
$password = Null;
$ad_type = Null;
$item_type = Null;
$year = Null;
$make = Null;
$length = Null;
$price = Null;
$contact_name = Null;
$contact_email = Null;
$contact_phone = Null;
$location = Null;
$description = Null;
*/
$db = "foo";
$tablename = "tblSA_ClassifiedAd";
$connection = mysql_connect("foo_server", "foo", "foo1")or die("Could not connect");
$dbs = @mysql_select_db ($db,$connection);
$sql = "Select * From tblSA_ClassifiedAd Order By id";
$result = @mysql_query($sql, $connection)or die("Could not Excute Query");
mysql_close();
if ($result)
{
$Ad .= "<table width=\"500\" align=\"center\" cellpadding=\"5\" cellspacing=\"5\">";
//$msg = $result;
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
$id = $row('0');
$user = $row('1');
$password = $row('2');
$ad_type = $row('3');
$item_type = $row('4');
$year = $row('5');
$make = $row('6');
$length = $row('7');
$price = $row('8');
$contact_name = $row('9');
$contact_email = $row('10');
$contact_phone = $row('11');
$location = $row('12');
$description = $row('13');
$Ad .= "
<tr>
<td> $id</td>
<td> $user;</td>
<td> $password;</td>
<td> $item_type;</td>
<td> $ad_type;</td>
<td> $year</td>
<td> $make</td>
</tr>
<tr>
<td> $length</td>
<td> $price</td>
<td> $contact_name</td>
<td> $contact_email</td>
<td> $contact_phone</td>
<td> $location</td>
<td> $description</td>
</tr>";
$Ad .= "</table>";
}
mysql_free_result ($result);
}
else
{
$msg .= "No Data to display.";
}
?>
<html>
<head>
<title>Ad Display</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p></p>
<p></p>
<p></p>
<? echo "$msg"; ?>
<? echo "$Ad"; ?>
</body>
</html>