RE: [PHP] Prob with displaying data from database

From: Date: Fri, 10 Nov 2000 08:40:25 +0000
Subject: RE: [PHP] Prob with displaying data from database
Groups: php.general 
Request: Send a blank email to php-general+get-24633@lists.php.net to get a copy of this message
You may be past this, but can you connect to the database ok? The manual notes say: To connect to an IBase server on windows NT, try this: $host="localhost:C:\\Systems\\Rpi\\test.gdb"; Note the "\\" On some versions of Interbase for WinNT4, NETBEUI needed an odd format: \\localhost\c:\database.gdb ^ - not sure why, but it works. It would also never connect unless the entire drive was shared. Have a look at: http://www.php.net/manual/function.ibase-connect.php Also try to see if it can connect successfully, and retrieve spousesurname with the following: <?php $host = "localhost:C:\Systems\Rpi\test.gdb"; //You may need to modify this as described above. $username = "day"; $password = "day"; $dbh = ibase_connect ($host, $username, $password); $stmt = 'SELECT * FROM client'; $sth = ibase_query ($dbh, $stmt); while ($row = ibase_fetch_object ($sth)) { print $row->SPOUSESURNAME . "\n"; } ibase_close ($dbh); ?> Hope this helps! Lawrence. -----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 (#24633) next »