simple connection issue
Posted: Mon Nov 14, 2005 6:01 pm
I'm working with an Access database. When I started at this job, there was already a working database in place. I've recently created a new one, but it doesn't work for some reason. The connection code is:
db_connection.php
Then, in another script, I have:
login.php
I get the error:
The "logins" table definitely exists. I've added this database in Data Sources in the Control Panel. What did I miss?
Thanks,
Jason
db_connection.php
Code: Select all
<?php
$db_connection = NULL;
$db_name = 'mail';
$db_user = NULL;
$db_password = 'xxxxxxx';
if (!($dbConnection = @ odbc_connect($db_name, $db_user, $db_password))) {
echo "Could not connect to the database.";
}
ob_start('ob_gzhandler');
@session_start();
?>login.php
Code: Select all
<php
include_once('db_connection.php');
$sql = "SELECT * FROM logins;";
odbc_exec($db_connection, $sql);
?>Code: Select all
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in c:\wwwroot\taxsale\mail\login.php on line 70Thanks,
Jason