note 40190 rejected from class.com by vincent
| From: | vincent@php.net | Date: | Tue, 24 Feb 2004 21:28:23 +0000 |
| Subject: | note 40190 rejected from class.com by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65667@lists.php.net to get a copy of this message | ||
Note Submitter: happys2k@hotmail.com
----
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
)