Next Generation Emulation banner
1 - 3 of 3 Posts

·
Registered
Joined
·
1,352 Posts
Discussion Starter · #1 · (Edited)
I used this code:

PHP:
$dbserver = "localhost";
$dbname = "php-test";
$dbuser = "root";
$dbpass = "";

$dbcon = MYSQL_CONNECT($dbserver,$dbuser,$dbpass) or die ("Connection to database-server failed");
if ($dbcon)
   {
   print "Connection to Database succesful";
   };
The Problem is that PHP always says that the connection succesful. I'm quite new to this whole PHP-thing and this is not a very difficult problem, I guess.
 

·
Registered
Joined
·
708 Posts
You must have the exact information on your MySQL account (database name, user name, password), otherwise it won't work.

Look at here:

$dbserver = "localhost"; <-- no need to change this, most server use localhost as default
$dbname = "php-test"; <-- your database name
$dbuser = "root"; <-- your user name
$dbpass = ""; <-- don't fill this blank, or MySQL think it's anonymous


;)
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top