MySQL Help

Status
Not open for further replies.

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
Can anyone tell me whats wrong with this code?
Code:
$server = 'localhost';
$username = 'kapoora_dirtybd';
$password = 'XXXXXX';
$database = 'dirtybirdreport';
 $mysqlconnection = mysql_connect($server, $username, $password);
$databaseconnection = mysql_select_db($database, $mysqlconnection);

i copied that straight from Bryon's tutorial and its still not working. i'm not a programming n00b. i do this for a living. seriously, i work with php and mysql at my day job. and i still can't connect to mysql. :-( somebody pleeeeeeeeeease help me!!

this is the error that shows up on the page:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'kapoora'@'localhost' (using password: NO) in /home/kapoora/public_html/dirtybirdreport.com/functions.php on line 9

i dont know why its not using the username and pwd i'm passing in. is it possible that SQL Safe mode is on?


also with fantastico being down, is it now impossible to install WordPress?
 
Last edited:

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Your script seems fine, maybe you should look at your settings and permissions in cPanel. I don't know about WordPress.
 
Last edited:

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
@chougard:
tried that, didn't solve the problem. thanks though. any other suggestions?

@twinkie:
where exactly in cPanel would I look? I checked my Remote MySQL stuff, and I have these servers on my list:
10.10.96.130
74.86.116.190 (cossacks)
127.0.0.1

and everytime i try adding localhost to the list it doesn't show up. i'm pretty much stuck at this point. :-(
 

Synkc

Active Member
Messages
1,765
Reaction score
0
Points
36
I've rewritten your code so it's eaiser to read; the only possibly reasons I can see as to why your's isn't working would be because:

1) You have not linked your database user with the actual database,
2) You have mispelled your database/user/pass,
3) As chougard said, you are not using the correct prefix for your database (all databases have the prefix "yourCpanelUsername_").

PHP:
$dbConnect = mysql_connect("localhost", "kaporra_dirtybd", "password");
$dbSelect = mysql_select_db("kaporra_dirtybirdreport", $dbConnect);
 
Last edited:
Status
Not open for further replies.
Top