-
Posts
4 -
Joined
-
Last visited
-
Days Won
1
Posts posted by AquaMorph
-
-
I am using code that looks like this:
<?php $db_con = mysql_connect("localhost","root","abc123"); if (!$db_con){ die('Could not connect: ' . mysql_error()); } mysql_select_db("my_data", $db_con); ?>
I am trying to connect to a MYSQL Database I made, but the script keeps returning an error "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/teampyro/public_html/scout/config.php on line 2
Could not connect: Access denied for user 'root'@'localhost' (using password: YES)"
This is a very noobish question but how should I connect to my database?
- hishMaist and brierbpromi
-
2
-
OK that is what I thought but I was hoping I was wrong.
-
So I want to change the folder my main domain is in. How would I go about doing that?
Connecting to MYSQL Database
in Scripts & Programming
Posted
Nevermind I figures is out. I need to use my cPanel settings to login.
<?php
$db_con = mysql_connect("localhost","cpanel_username","cpanel_password");
if (!$db_con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_data", $db_con);
?>