witham Posted May 29, 2010 Share Posted May 29, 2010 Hi I hope someone can help I have been searching the net for hours looking for a solution. I have mysql running through xampp on a laptop running windows vista. I also have the identical setup on a pc running xp which works perfectly. My issue is that whilst I can connect to phpmyadmin through localhost I cannot connect ant databases that have been imported from the xp setup. The error I get is below, I have tried to echo the Host and password ect but they don't appear? Could not connect to database server: \n"); // mysql_select_db selects a database to use on the database server //pointers to by $dblink // the @ sign before the command supresses any error messages @mysql_select_db ('weld' , $dblink) or die (" Could not connect to the database \n"); echo 'Host: '.$dbhost.' '; echo 'Username: '.$dbuser.' '; echo 'Password: '.$dbpass.' '; echo 'Database: '.$dbname; ?> Error Processing Query As the php works perfectly on xp setup I can't determine where the problem is?? Quote Link to comment https://forums.phpfreaks.com/topic/203281-cannot-connect-to-server/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 29, 2010 Share Posted May 29, 2010 That's not an error. It is raw php code. You are likely using short open tags <? If you only use full opening php tags <?php you will avoid this problem every time you switch servers. Quote Link to comment https://forums.phpfreaks.com/topic/203281-cannot-connect-to-server/#findComment-1065039 Share on other sites More sharing options...
witham Posted May 29, 2010 Author Share Posted May 29, 2010 Thank you problem solved can't believe it was that simple. Quote Link to comment https://forums.phpfreaks.com/topic/203281-cannot-connect-to-server/#findComment-1065043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.