oustu Posted December 11, 2008 Share Posted December 11, 2008 I have recently installed Xampp and made a simple php file. When I try to connect to my server with the basic username("root") and no password, I just get this: Could not connect: My code looks like this: <html> <body> <?php $con = mysql_connect("localhost","root"); if ($con) { die('Could not connect: ' . mysql_error()); } ?> </body> </html> I haven't really messed with any other settings so can anybody tell me if I am missing something or doing something wrong? thanks Quote Link to comment https://forums.phpfreaks.com/topic/136447-solved-connecting-to-sql-server-on-xampp/ Share on other sites More sharing options...
corbin Posted December 11, 2008 Share Posted December 11, 2008 if($con) I think you meant to put if(!$con). Quote Link to comment https://forums.phpfreaks.com/topic/136447-solved-connecting-to-sql-server-on-xampp/#findComment-712220 Share on other sites More sharing options...
oustu Posted December 11, 2008 Author Share Posted December 11, 2008 Hahaha, it worked. Thanks a lot. I have been spending the last three days trying to find out what was wrong. Quote Link to comment https://forums.phpfreaks.com/topic/136447-solved-connecting-to-sql-server-on-xampp/#findComment-712895 Share on other sites More sharing options...
corbin Posted December 11, 2008 Share Posted December 11, 2008 No prob. Quote Link to comment https://forums.phpfreaks.com/topic/136447-solved-connecting-to-sql-server-on-xampp/#findComment-713089 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.