Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-17-2008, 11:08 PM   #1 (permalink)
sublimer
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default Frustration...

I have 1and1 hosting. I made some files last summer and haven't touched them until I started trying to figure out the error. About two weeks ago some parts of my site stopped working, for no known reason, I hadn't touched these files in about 10 months and all of a sudden I started getting errors. I called 1and1 and as with most customer service experiences, it sucked and wasted my time, hopefully you will be of help! Below is an example of what isn't working, it is used to submit a news article, pretty simple, straight forward script, but I'm clueless!

I removed the MySQL login details, but I assure you they are correct, I've tripled checked and even someone at 1and1 said that the information was correct. The error I get is...

Access denied for user: '***@%' to database '***'

That would imply that my login credentials are wrong, but they aren't.

PHP Code:
<?php

    
#database connection
    
mysql_connect("***""***""***") or die;
    
mysql_select_db("***") or die;
    
    
$subject $_POST['subject'];
    
$body $_POST['body'];
    
$publisher $_POST['publisher'];
    
$url $_POST['url'];
    
$date $_POST['date'];
    
$numdate $_POST['numdate'];
    
    
$date date("l " " F " " jS, " " Y");
    
        function 
getdays($day1,$day2)
        {
          return 
round((strtotime($day2)-strtotime($day1))/(24*60*60),0);
        }
    
        
$begin "2000/1/1"// we set today as an example
        
$end date("Y/m/d");
    
        
$numdate getdays($begin,$end);
    
    
$result mysql_query("INSERT INTO news (subject,body,publisher,url,date,numdate) VALUES ('$subject', '$body', '$publisher', '$url', '$date', '$numdate')");
    if(
mysql_affected_rows() > 0)
    {
        echo(
"News sucessfully added");
    }
    else 
    {
      echo(
mysql_error());
      exit();
    }
    
    echo (
"<br>");
    include 
"news_submit_form.html";

?>
sublimer is offline   Reply With Quote
Sponsored Links
Old 06-18-2008, 12:00 AM   #2 (permalink)
SuperNovaArcade
Junior Member
 
SuperNovaArcade's Avatar
 
Join Date: May 2008
Location: United States
Posts: 55
Default Re: Frustration...

Have you checked to make sure the mysql admin username that is specified in the script has FULL PRIVALEDGES on the specified database?
__________________
SuperNovaArcade.com - Free Flash Arcade Games
SuperNovaArcade is offline   Reply With Quote
Old 06-18-2008, 12:02 AM   #3 (permalink)
sublimer
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default Re: Frustration...

yes, besides i use the same few lines of code to connect on other pages on my site and it works fine.
sublimer is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:28 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums