error 405


#1

I’m following a tutorial on inserting into a MySQL database the inital page loads up fine but when I submit I get a HTTP error 405.

This is my code:

[code]

<?php if ($submit) { // process form $db = mysql_connect("localhost", "root"); mysql_select_db("test",$db); $sql = "INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position')"; $result = mysql_query($sql); echo "Thank you! Information entered.n"; } else{ // display form ?>

First name:

Last name:

Address:

Position:

<?php } // end if ?> [/code]

Has anyone got a any suggestions, I think the code is fine, because I’ve directly copied it out of the tutorial.

Something isn’t set up right, thinks I…

Jade.


#2

hey, glad no-one has replied yet. But for anyone else who has this problem it’s really easy…

just put in some error handling…

error_reporting  (E_ERROR | E_WARNING | E_PARSE);

i thought it just stopped all the errors on the screen, but it obviously does more!