note 40190 added to class.com

From: Date: Tue, 24 Feb 2004 20:20:31 +0000
Subject: note 40190 added to class.com
Groups: php.notes 
Request: Send a blank email to php-notes+get-65665@lists.php.net to get a copy of this message
How can I use (*.mdb)files on unix-php server ? ======================= <html> <body> <table border=1> <?php //create the database connection $conn = new COM("ADODB.Connection"); #$dsn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("MAAREF.MDB"); $dsn ="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=". realpath("MAAREF.MDB"); $conn->Open($dsn); //pull the data through SQL string $rs = $conn->Execute("SELECT * FROM st_student"); $clients = $rs->Fields(3); //start the multicolumn data output $i = 0; $columns = 5; while (!$rs->EOF){ //if $i equals 0, start a row if($i == 0){ echo "<tr>"; } //then start writing the cells in the row, increase $i by one, and move to the next record echo "<td>" . $clients->value . "</td>"; $i++; $rs->movenext(); //once $i increments to equal $columns, end the row, //and start the process over by setting $i to 0 if($i == $columns || $rs->EOF) { echo "</tr>"; $i = 0; } } //end multicolumn data output //close the ADO connections and release resources $rs->Close(); $conn->Close(); $rs = null; $conn = null; ?> </table> </body> </html> ======================== This code is working with my PC , But after upload it to web retern message (Fatal error: Cannot instantiate non-existent class: com in /home/alkhuzai/public_html/mdb.php on line 6 ) ---- Manual Page -- http://www.php.net/manual/en/class.com.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40190 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40190&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40190&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65665) next »