If I understood your question correctly, you are connecting a client script onto a mysql database.
Use the built-in PHP mysql functions
$dbhost = 'localhost';
$dbuser = 'someuser';
$dbpass = 'somepassword';
$dbase = 'database_to_use';
$cnx = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Cannot connect to Database Host: $dbhost with Username: $dbuser and Password: $dbpass");
mysql_select_db($dbase) or die ("Cannot use the database: $dbase");
If you use Windows ODBC to connect:
try the following, assuming that your odbc has been properly set up
$dbuser = 'someuser';
$dbpass = 'somepassword';
$dbase = 'database_to_use';
$cnx = odbc_connect($dbase, $dbuser, $dbpass) or die ("Cannot connect to ODBC database: $dbase with Username: $dbuser and Password: $dbpass");
Make sure to grant permission to the internet user or create a special application role or user for $dbuser
in query analyzer (in microsoft sql 7)
grant all on $dbase to $dbuser;
or in mysql;
bin/mysql -u root -pPassword -e mysql 'GRANT ALL ON databasename.* TO username IDENTIFIED BY 'password'";
if that doesn't work then you'll have to log in and do that command.
hope that helps.
jm
use mysql;
$cnx = odbc_connect