- This topic is empty.
-
AuthorPosts
-
April 8, 2010 at 2:39 pm #28667
MichaelR
MemberHi, I’m having some trouble with a script I’m making I see this error:
Warning: mysql_query() [function.mysql-query]: Access denied for user ‘rettro’@’localhost’ (using password: NO) in /home/rettro/public_html/admin/post.php on line 52
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/rettro/public_html/admin/post.php on line 52
I’ll show you the page If that helps?
Code:
” . $sql . “
” . mysql_error());while($row = mysql_fetch_array($result)) {
$date = date(“l F d Y”, $row[‘timestamp’]);
$title = stripslashes($row[‘title’]);
$entry = stripslashes($row[‘entry’]);
$password = $row[‘password’];
$get_categories = mysql_query(“SELECT * FROM php_blog_categories WHERE `category_id` = $row[category]”);
$category = mysql_fetch_array($get_categories);if ($password == 1) {
if (isset($_POST[‘username’]) && $_POST[‘username’] == $my_username) {
if (isset($_POST[‘pass’]) && $_POST[‘pass’] == $my_password) {
?>Sorry, wrong password.
‘ . $title . ‘
‘;
printf(“
This is a password protected blog post. If you have a password for the post, enter it below.
“);
printf(“
“,$id);
print ““;
}
}
else { ?>“>
Posted on . Posted in . 0) {
echo “” . $num_rows . “Comments“;
}
else {
echo “Leave a Comment“;
} ?>” . $sql . “
” . mysql_error());
while($row = mysql_fetch_array($result)) {
$timestamp = date(“l F d Y”, $row[‘timestamp’]);
printf(‘“);
}?>
” . $sql_prev . “
” . mysql_error());while ($row = mysql_fetch_array($result_prev)) {
$prev = $row[‘id’];
}if (isset($prev)) {
// print a previous link
printf(“Previous “, $prev);
}
else {
// just print the word “previous”print “Previous “; ?> |
‘$id’ ORDER BY id LIMIT 1″;
$result_next = mysql_query ($sql_next) or print (“Can’t select next entry id table php_blog.
” . $sql_next . “
” . mysql_error());while ($row = mysql_fetch_array($result_next)) {
$next = $row[‘id’];
}if (isset($next)) {
// print a next link
printf(“ Next“, $next);
}
else {
// just print the word “next”print ” Next”;
}
} ?>I’m really unsure on what do do, Michael. :roll:
I don’t know for sure. Is it possible that you don’t have permissions set up on the database for that user? does retro have full read, write access
As cybershot said above, a "Access denied for user" error usually indicates either incorrect permissions or an incorrect database username or password. I’d double check your database login details and make sure they are correct.
- The forum ‘Back End’ is closed to new topics and replies.
printf(“
%s. On %s
“, stripslashes($row[‘url’]), stripslashes($row[‘name’]), $timestamp);
print(“
” . stripslashes($row[‘comment’]) . “
“);
printf(“