added variable identifier $ to 'row' variables on others.
while ($row=mysql_fetch_array($mysql_result)) {
$ID=$row['ID']; # this is line 30
$first_name=$row['first_name'];
$surname=$row['surname'];
$email=$row['email'];
$comments=$row['comments'];
HTH,
Jason k Larson
Aaron Downes wrote:
Dear Sir/Madam,
trying to displaying records by php get error :
Parse error: parse error in /hsphere/local/home/ozhomene/ardownes.com/ViewContacts.php on line 30
see below for code for ViewContacts.php :
<html>
<body>
<?
$connection=mysql_connect("localhost","",""); #am entering userID &password instead of ,"","")
IF (!$connection) {
echo "Could not connect to mySQL server";
exit;
}
$db=mysql_select_db("test_holding",$connection);
if (!$db) {
echo "Could not change the database";
exit;
}
#sql="SELECT * FROM contacts"; # name of table "contacts" with below fields
#mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);
if ( $num_rows == 0 ) {
echo "Sorry, there is no information.";
} else {
#we have results
while ($rows=mysql_fetch_array($mysql_result)) {
$ID=row['ID']; # this is line 30
$first_name=row['first_name']; $surname=row['surname'];
$email=row['email'];
$comments=row['comments'];
# display results
echo "$fist_name : $surname $email $comments<br>";
}
} # end else
mysql_close($connection);
?>
</body>
</html> Any help will be appreciated.
Best regards,
Aaron Downes
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php