function Take_Action($decision,$id){ $_SESSION['enemy']=My_Enemy_Is($id); $decline = strcmp($decision,"no"); if ($decline==0){ $con = mysql_connect(DB_HOST,"armiron_admin","admin"); if (!$con){ die('Could not connect: ' . mysql_error()); } mysql_select_db(DB, $con); $sql = mysql_query("DELETE FROM ".TABLE_CONTEST_ONE_ON_ONE." WHERE ID='".My_Enemy_ID_Is($enemy,$user)."'"); mysql_close($con); echo "Declined <a href=Script_View_Challenge_Requests.php>View My Challenge Requests</a>"; } else { header("Location: index_OneonOne.php?id=".$id."&challenge_back=yes"); } } PHP: Getting an error saying Warning: mysql_query() [function.mysql-query]: Access denied for user 'armiron'@'localhost' (using password: NO) in /home/armiron/public_html/Invisible_Functions.php on line 884 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/armiron/public_html/Invisible_Functions.php on line 884 Warning: mysql_close(): 3 is not a valid MySQL-Link resource in /home/armiron/public_html/Invisible_Functions.php on line 886 Declined View My Challenge Requests Code (markup): Now I made the database then i made the user gave him all the privileges and still does not work would you tell me how i could fix the problem? Thanks, - Avo
Well if you are on a cPanel server I would change DB_HOST to localhost Have fun edit: but usually the connnect file takes the form of localhost, databasename, username, password. Are you sure you entered all the other info correctly?
it looks like it is the file: /home/armiron/public_html/Invisible_Functions.php line 884: it is using mysql user "armiron" vs the code snippet that you posted, which is using user "armiron_admin"
DB_HOST equals to localhost i used define for that and i checked the login info here is one question though the password and the username are the once for the user that i create using MySQL right it is not the password and the username for my account I really dont know what is causing this problem - Avo
I sometimes got this error when I didn't give enough privileges when I create the database. if you have cPanel goto your Mysql databases and click on the user name for your database and tick ALL PRIVILEGES checkbox and save
Hi Check the username and password is correct or not on your control panel. And also give the previlegies on your control panel. Regards Parthiban
Are you sure that your host is using localhost ( in most cases, you get a custom mysql host address ) ?