error msg: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mon'@'localhost' (using password: YES) in C:\xampp\htdocs\project\include\connection.php on line 7
Could not Connect


///my connection.php code
<?php
define("contype","localhost");
define("user","mon");
define("passwd","affinity");
define("db","project");

$con=mysql_connect(contype,user,passwd) or die('Could not Connect');
$dbcon=mysql_select_db(db);
?>

//here's my scenario. i add new USER to my mysql in phpmyadmin and its username=mon, password=affinity + function(password) then i cant connect using this account... but using root account, works fine... help guys.

Recommended Answers

All 3 Replies

Did you give the user privileges to access the database projects?

commented: thanks +1

yes i give privileges select insert delete update create drop. and i also reload that... :(

yes i got it.. i found my mistake :) thanks dude for pointing me near to my error... i found in my mysql>user my host is also mon instead of localhost thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.