Jump to content

I am getting sql error


annie2478

Recommended Posts

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

 

<?php

include "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

Link to comment
https://forums.phpfreaks.com/topic/273251-i-am-getting-sql-error/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.