404 Error on PHP/MySQL Page

Posted on 2011-04-25
Last Modified: 2012-05-11
Hi, all!

Have a rather complex PHP/MySQL page.  It uses a bit of JavaScript to display/hide fields according to user type, change values shown without re-submitting, format and validate input, etc.  It will submit fine, as long as I don't try to insert/update.  If that logic is called, I get a 404 "Not Found" error.  Never seen this before.  Either it won't submit at all (usually the "action" value in the form tag) or, if there is some kind of error, it displays the page with whatever error occurs.

The page flow is pretty standard.  If parameter indicates a new record, defaults for the field are set.  If not, I look for $_POST for the fields and use them.  If they are not there, I load from the database.

Following that logic, I test for insert/update being requested. (Was testing for the $_POST from the Save button, but when I started troubleshooting I switched that to a value from a field that I set with JavaScript.)

Don't think it's data access rights because other forms update OK and all use the same DB connection.  Might be memory limit or other setting of some kind on the server, but that's over my head.

Generally, has anyone seen this before?  It's new to me and I could use some help.  I can cut/paste some of the relevant code if you can point me to what may be relevant.


Question by:springthorpeSoftware
    LVL 10

    Accepted Solution

    I think you need to debug your code ,
    assuming your query is in $query
    try after mysql query to do something like this

    echo $query ;

    Now you should get the query  copy it and paste it in phpmyadmin and see if you will get the result or not , based in your finding i can help you more
    LVL 10

    Expert Comment

    one more point  , make sure in your form action you are submitting to the right script .
    if you are submitting to the same script use its name and don't just leave it blank.

    Author Comment


    Let me be "honest" with you.  I'm a dumb #@!.  It was a 550 error, not a 404.  I guess when you look at something too long you just don't see it.

    Anyway, research here at Experts Exchange for the correct (550) problem revealed that changing an IE setting to not "Show friendly HTTP error messages" allowed the echos I put in to debug to show on the screen.  (The form still didn't show.)  Then it was just a matter of tracking down where the error was occuring.

    It was a mis-spelled function name for a call to the PHP include file that verified data just before the record was written.  Simple, stupid finger check.

    Thanks for making me step back from it.  More importantly, thank you for responding so quickly.  Don't know what I'd do without the help you and other experts provide.


    Author Closing Comment

    Made me go back and look at problem again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now