RE: [PHP] Prob with displaying data from database

From: Date: Fri, 10 Nov 2000 08:46:06 +0000
Subject: RE: [PHP] Prob with displaying data from database
Groups: php.general 
Request: Send a blank email to php-general+get-24636@lists.php.net to get a copy of this message
The other problem you have is: $SPOUSESURNAME= $row["SPOUSESURNAME"]; ... <body> <?$SPOUSESURNAME = "TESTING";?> <? echo "This is hard coded - Spouse Surname".$SPOUSESURNAME;?> <input type="text" name="SPOUSESURNAME" value=<? $SPOUSESURNAME?>> You are overwriting spousesurname with testing You should be doing: <? print $SPOUSESURNAME; ?> What your code does is get spousesurname from the db (hopefully ;) ) ,then replace the contents with TESTING I think you probably want to do something like <? $username="day"; $password="day"; $dbhost='localhost:C:\Systems\Rpi\test.gdb'; $connection = ibase_connect($dbhost,$username,$password) or die ("Couldn't connect to server"); //$db=ibase_select_db("test.gdb",$connection); $GetClientDetailQuery = "SELECT PERSAL, SPOUSESURNAME FROM CLIENT WHERE PERSAL = 'ADM108'"; $GetClientDetailQuery_Result = ibase_query($GetClientDetailQuery,$connection) or die ("Couldn't execute query"); $row = ibase_fetch_row($GetClientDetailQuery_Result); $SPOUSESURNAME= $row["SPOUSESURNAME"]; ?> <html> <body> <? echo "This is the Spouse Surname".$SPOUSESURNAME;?> <input type="text" name="SPOUSESURNAME" value="<? echo $SPOUSESURNAME; ?>"> </body> </html> -----Original Message----- From: Sonya Davey / QDCEL [mailto:SonyaD@PQAfrica.co.za] Sent: November 10, 2000 04:26 PM To: 'php-general@lists.php.net' Subject: [PHP] Prob with displaying data from database Hi, I need some help with displaying data on a page from a database How do I display the value of the field SPOUSESURNAME onto the pg? This is what I have so far: <? $username="day"; $password="day"; $dbhost='localhost:C:\Systems\Rpi\test.gdb'; $connection = ibase_connect($dbhost,$username,$password) or die ("Couldn't connect to server"); //$db=ibase_select_db("test.gdb",$connection); $GetClientDetailQuery = "SELECT PERSAL, SPOUSESURNAME FROM CLIENT WHERE PERSAL = 'ADM108'"; $GetClientDetailQuery_Result = ibase_query($GetClientDetailQuery,$connection) or die ("Couldn't execute query"); $row = ibase_fetch_row($GetClientDetailQuery_Result); $SPOUSESURNAME= $row["SPOUSESURNAME"]; ?> <body> <?$SPOUSESURNAME = "TESTING";?> <? echo "This is hard coded - Spouse Surname".$SPOUSESURNAME;?> <input type="text" name="SPOUSESURNAME" value=<? $SPOUSESURNAME?>> Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#24636) next »