Re: php problem

From: Date: Tue, 04 Feb 2003 12:42:21 +0000
Subject: Re: php problem
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-15483@lists.php.net to get a copy of this message
Please direct such questions to php-general@lists.php.net or see http://php.net/support for more support options. Goba [one webmaster@php.net] Aaron Downes wrote:
Dear Sir/Madam, trying to displaying records by php can add a record but displaying data 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


« previous php.mirrors (#15483) next »