I just found out that I have to use mysql_pconnect on my web host. I tried a simple php script to make sure I have the syntax right and I keep getting an error - Warning: mysql_query() [function.mysql-query]: A link to the server could not be established. Access denied for user 'ODBC'@'localhost' (using password: NO).
Here is the php code. Any help would be greatly appreciated. Thank you.
<?php
$con = mysql_pconnect("localhost:3306", "xxxxx", "xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}$db_selected = mysql_select_db("loc");if (!$db_selected)
{
die ("Can't use test_db : " . mysql_error());
}mysql_close($con);
$query = "SELECT car_id, year, model FROM car_desc where mbr_id = 1";
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_assoc($result)) {
echo $row['car_id'];
echo $row['year'];
echo $row['model'];
}
mysql_free_result($result);
?>