Hi,
Here's the code for the mysql connection
<?php
function get_db_conn() {
$conn = mysql_connect($GLOBALS['db_ip'], $GLOBALS['db_user'], $GLOBALS['db_pass']);
if (!$conn) {
echo "Unable to connect to DB: " . mysql_error();
exit;
}
mysql_select_db($GLOBALS['db_name'], $conn);
return $conn;
}
if (!mysql_select_db($GLOBALS['db_name'])) {
echo "Unable to select db_name: " . mysql_error();
exit;
}
function get_prints($user) {
$conn = get_db_conn();
$res = mysql_query('SELECT from
, to
, time
FROM footprints WHERE to
=' . $user . ' ORDER BY time
DESC', $conn);
if (!$res) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
$prints = array();
while ($row = mysql_fetch_assoc($res)) {
$prints[] = $row;
}
return $prints;
}
The error that i'm getting is preceeded by "Unable to select db_name: "