My sql connection string suggestion!

naga harish

New Member
Messages
2
Reaction score
0
Points
0
Hi,

First I would like to say thanks to x10hosting.

And my suggestion is please add sample connection string for my sql data base. It new to my sql. I just thing of database host! finaly I added localhost as database host. if sample database connection is provided, then it will be helpfull to users. I feel!!!

Thanks.
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
Are you looking for a way to test the connection?

To test the connection, create a database in cPanel and the database user/pass. Then create a new PHP file with the following code:

PHP:
<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>

Replace admin with your database user.
Replace 1admin with your database password.
Replace test with your database name.

Keep all quotes in place.

If all goes well, it should display both Connected to MySQL and Connected to Database.

Source: http://www.tizag.com/mysqlTutorial/mysqlconnection.php
 
Last edited:

naga harish

New Member
Messages
2
Reaction score
0
Points
0
Are you looking for a way to test the connection?

To test the connection, create a database in cPanel and the database user/pass. Then create a new PHP file with the following code:

PHP:
<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>

Replace admin with your database user.
Replace 1admin with your database password.
Replace test with your database name.

Keep all quotes in place.

If all goes well, it should display both Connected to MySQL and Connected to Database.

Source: http://www.tizag.com/mysqlTutorial/mysqlconnection.php
Thanks for you reply. It is working form me :)
 
Top