Web Developers Forum & SEO Help
Web Developers ForumArticlesBlogLinks
topmenu

Programming and Scripts: Web Developers Forum

Go Back   TalkWebDev: Web Developers Forum for Web Designers & SEO Information > Web Development > Programming and Scripts
User Name
Password


Reply
 
Thread Tools Search this Thread
Old 04-21-2005, 08:52 PM   #1
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default Help! -- php

I'm having a bit of trouble with a php and sql script, the script below is the one that is not working. I'm an ameture at this, so please excuse me if it's a really simple answer.

When I use the below script the responce is:

Quote:
Warning: mysql_query(): Access denied for user: 'rauru@localhost' (Using password: NO) in /home/rauru/public_html/blog/admin/process.php on line 17

Warning: mysql_query(): A link to the server could not be established in /home/rauru/public_html/blog/admin/process.php on line 17
Couldn't create the update


Code:
<?php include("admin/connect.php"); $update_name = $_POST['update_name']; $blogshort = $_POST['blogshort']; $bloglong = $_POST['bloglong']; if ($update_name="" AND $blogshort="" AND $update_name="") { header("Location: admin/update.php"); } else { $update = "INSERT INTO blog ('update_name, date, blog, bloglong) values('$update_name','".time()."','$blog','$bloglong')"; mysql_query($update) or die("Couldn't create the update"); header("Location: index.php"); } ?>


Is there any reason for this?
Archaic Sage is offline   Reply With Quote
Old 04-22-2005, 12:01 AM   #2
Purple Haze
TalkWebDev Enthusiast
 
Join Date: Mar 2005
Posts: 37

Default

The error looks like it means that PHP could not connect to your MySQL server.

You either:

a. Did not including the correct connect.php file
b. Have the wrong login information for MySQL in your connect.php
c. Are not connecting to the correct server OR
d. Your user does have sufficient MySQL privileges
__________________
Sticky Icky

Last edited by Purple Haze : 04-22-2005 at 04:57 PM.
Purple Haze is offline   Reply With Quote
Old 04-22-2005, 11:21 PM   #3
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default

All of the info is correct on the connect.php file, I can't see why it would be connecting to the wrong server. I use localhost as the server, and the database is fine.
Archaic Sage is offline   Reply With Quote
Old 04-23-2005, 12:35 AM   #4
Purple Haze
TalkWebDev Enthusiast
 
Join Date: Mar 2005
Posts: 37

Default

If you are hosting your own server, I would check to make sure your MySQL user has sufficient permissions, otherwise, I can't see why you would be having this error, I'll check it out more later.
__________________
Sticky Icky
Purple Haze is offline   Reply With Quote
Old 04-25-2005, 07:59 PM   #5
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default

Quote:
Warning: mysql_query(): Access denied for user: 'rauru@localhost' (Using password: NO) in /home/rauru/public_html/blog/admin/process.php on line 17

Warning: mysql_query(): A link to the server could not be established in /home/rauru/public_html/blog/admin/process.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /home/rauru/public_html/blog/admin/process.php:17) in /home/rauru/public_html/blog/admin/process.php on line 18


PHP Code:
<?php
include("http://blog.raurusreturn.net/admin/connect.php");

$update_name $_POST['update_name'];
$blogshort $_POST['blogshort'];
$bloglong $_POST['bloglong'];
$date time();

if (
$update_name=="" AND $blogshort=="" AND $update_name=="")
{
    
header("Location: http://blog.raurusreturn.net/admin/update.php");
}
else
{
    
mysql_query("INSERT INTO
    blog ('update_name', 'date', 'blog', 'bloglong')
    values($update_name,$date,$blog,$bloglong)"
);
    
header("Location: index.php");
}
?>


I changed the code a little, and I got a new error. It seems to be isolated around the value area. But usually errors are before that line. So I can't really seem to find the error.

The mysql_query works, as I use it in other scripts.
Archaic Sage is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mastering Regular Expressions in PHP Lars Programming 0 04-12-2005 11:13 PM
Pre-made script > PHP > Displaying Database Information Purple Haze Programming and Scripts 6 04-11-2005 10:00 PM
Pre-made script > PHP > Tell-a-Friend Script Purple Haze Programming and Scripts 4 04-05-2005 07:38 PM
Pre-made script > PHP > Uploading multiple files to a directory Purple Haze Programming and Scripts 0 03-30-2005 03:25 AM
php mysql tutorials Hoju Programming and Scripts 5 03-18-2005 04:45 PM


All times are GMT. The time now is 05:39 PM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

 
Admin CP Mod CP About Us Contact Us Top