Database not connection

robee29

New member
hi there, I already uploaded my website but i have problem connecting my database. I havent put any password on the database yet and this is how I connect my application

<?php
$cnx_id = @mysql_pconnect('localhost','root','');
@mysql_select_db('mydatabase') or die("dbase error");
?>

but it always return the database error, I also change the 'localhost' to my domain site but it is not connection. what could be the problem?

Thank you, your help will be much appreciated.

cPanel username : suzane
Domain: ebizstore.gi9.co
 

un4saken

Administrator
First of all leave "localhost" as it is. Login to your cPanel and create a new mysql user & database. Then change your mysql connection with that user, password and the database. like

Code:
 <?php
 $cnx_id = @mysql_pconnect('localhost','mysqlusername','mysqlpassword');
 @mysql_select_db('mysqldatabase') or die("dbase error");
 ?>
 

robee29

New member
oh it is working now. i did not change the localhost thing but now it is ok..your code works


Code:
<?php
$cnx_id = @mysql_pconnect('localhost','mysqlusername','mysqlpassword');
@mysql_select_db('mysqldatabase') or die("dbase error");
?>
THANKS @un4saken thanks very much :D
 

robee29

New member
why can't I marked this thread as SOLVED? It always return this Error: Please select a new status, user to assign the thread to, priority or category.