Okay, I apoligize in advance for what is a elementary question, but I'm new to PHP and databasing. So here goes...
I want to connect to my database (newsLetterMailList.mdb) and return the records and display them on my page, from the table (emailAddresses), column (Email_Address). My database resides on a Windows server and the DSN is (registered_email). The permissions have been configured for the database directory by the host company outside of my /html directory.
I try to connect , but get the following error (Fatal error: Call to a member function on a non-object in d:\html\users\strawnsnet\html\members\letter\data.php on line 17).
Here is what I'm trying to connect with...
<body bgcolor="#FFFFFF" text="#000000">
<?
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Microsoft Access connection string.
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\inetpub\wwwroot\php\newsletterMailList.mdb");
// SQL statement to build recordset.
$rs = $conn->Execute("SELECT Email_Address FROM emailAddresses");
echo "<p>Below is a list of values in the NEWSLETTERMAILLIST.MDB database, EMAILADDRESSES table, EMAIL_ADDRESS field.</p>";
// Display all the values in the records
// et
while (!$rs->EOF) {
$fv = $rs->Fields("Email_Address");
echo "Value: ".$fv->value."<br>\n";
$rs->MoveNext();
}
$rs->Close();
?>
</body>
Could someone please help me with what I'm sure is a simple task?
Thanks in advance :-)