annie2478 Posted January 16, 2013 Share Posted January 16, 2013 Hello I am trying to fix an error and I am getting the message error I have tried everting I could to do to install it myself and fix it to no avail can someone please help me. the error is: "Warning: mysql_query() [function.mysql-query]: Access denied for user 'xxxxx'@'localhost' (using password: NO) in /home/xxxxx/public_html/xxxxx.COM/index.php on line 6 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/xxxxx/public_html/xxxxx.COM/index.php on line 6 Access denied for user 'xxxxx'@'localhost' (using password: NO)" I used to xxxxx's to hide my private info here's the script code <?phpinclude "conn.php"; include "output.php"; $sql = "select * from recipes where picture <> '' and approved='1' order by id desc limit 20"; $rec = mysql_query($sql) or die(mysql_error()); $tr=0; $bg="#FEE17E"; $datas_array=array(); while($datas=mysql_fetch_array($rec)) { $datas_array[] = $datas; } $body .= outputRecipes($datas_array); $curl ="http://" .$_SERVER['HTTP_HOST']; $rss="$url/rss.php"; $title = "Free tasty recipes - $domain"; $headertitle = "Free Recipes"; $mytemp = "false"; include "template.php"; ?> can anyone help any suggestions appreciated!!!! thanks annie Quote Link to comment https://forums.phpfreaks.com/topic/273251-i-am-getting-sql-error/ Share on other sites More sharing options...
requinix Posted January 16, 2013 Share Posted January 16, 2013 (edited) What's in conn.php? [edit] Assuming there's a mysql_connect() in there, be sure to not post the username you tried to connect with. And while I'm at it, the error message is telling you that you didn't put the password in. You probably need to. Edited January 16, 2013 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/273251-i-am-getting-sql-error/#findComment-1406214 Share on other sites More sharing options...
PFMaBiSmAd Posted January 16, 2013 Share Posted January 16, 2013 Php's trying to make a database connection at the mysql_query() statement. That means that your actual mysql_connect code isn't making a connection or the code isn't being seen as being php code at all. Quote Link to comment https://forums.phpfreaks.com/topic/273251-i-am-getting-sql-error/#findComment-1406217 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.