MySQL db connection script

I am working on CMS and i can’t quite fiqure out why it won’t work. the host is correct even though it doesnt have a full url. That isnt it.

//Configuration file
$siteName = ‘PHMe’;
$siteLocationWWW = ‘’;
$siteLocationServer = ‘unknown’; #If ya’ don’t know type ‘unknown’ letter for letter, all lower case, should not affect overall preformance
$mainAdminID = ‘catfacts’;

//Server Config
$host = ‘mysql4-p’;
$username = ‘un90j09j0j’;
$password = ‘pwjk3kr4jl3’;
$databaseName = ‘p198164_phme’;
$prefix = ‘phme_’;

//Don’t Touch
$connect = mysql_connect($host, $username, $password);
$db = mysql_select_db($databaseName, $connect1);

//connect to the database NEWS
$sql = ‘SELECT * FROM phme_news’;
$News = mysql_query($sql, $connect);
$news = mysql_fetch_array($News);

//connect to the database MESSAGE
$sql = ‘SELECT * FROM phme_message’;
$Message = mysql_query($sql, $connect);
$messages = mysql_fetch_array($Message);

//connect to the database GALLERY
$sql = ‘SELECT * FROM phme_gallery’;
$Gallery = mysql_query($sql, $connect);
$gallery = mysql_fetch_array($Gallery);

//connect to the database NAV
$sql = ‘SELECT * FROM phme_nav’;
$Gallery = mysql_query($sql, $connect);
$gallery = mysql_fetch_array($Gallery);

//connect to the database MEMBERS
$sql = ‘SELECT * FROM phme_member’;
$Gallery = mysql_query($sql, $connect);
$gallery = mysql_fetch_array($Gallery);

Admin Edit: Added [PHP] Tags for readability. Please see for posting guidelines.

See my sig.

Was this resolved?
I didn’t go very far, but look at your $connect variable in your “Don’t Touch” section.
The database uses an unknown(to this code snippet) connection = $connect1, but you previously assign the connection to $connect.
Hopefully that’s all it was, but look closely at everything else too.

Sponsor our Newsletter | Privacy Policy | Terms of Service