kdalts
04-25-2012, 02:20 PM
Hi Guys..
I have developed some scripts using php/mysql locally and they work fine. I can add, delete, view and edit records perfectly. There are 3 of these files and they all work the same. The add function looks like this...
//now perform the add routine
function add2SQL() {
//additional var to save not already posted from the form
$change_requestor=$_SESSION['fullname'];//default user
$change_status= "New Request";/default status
$today = date("d-m-y");//default entry date
include '../config.php'; //connect to the database
//8 fields and 8 values
mysql_query("INSERT INTO change_log (request_date, change_headline, change_description, change_reason, change_priority, change_requestor, change_type, change_status) " .
"VALUES ('$today', '$_POST[change_headline]', '$_POST[change_description]', ".
"'$_POST[change_reason]', '$_POST[change_priority]', '$change_requestor', ".
"'$_POST[change_type]', '$change_status')");
}
The 3 scripts are identical except for the database table name and, of course, the fields.
So I have publised this now to my server and for some reason 1 script works and 2 do not. The 2 that do not work give back no error message (error_reporting = E_ALL & ~E_NOTICE) - the data simply does not add to the DB. The list, update and delete works on all scripts so I know that the databases work fine. I've echo'd the values back and they are all correct too - session vars are present but the record simply won't add to my tables.
I've been on this now for 2 days and I simply can't figure out what's wrong. Any one spot anything obvious or know of a way I can trace what's happening please?
I have developed some scripts using php/mysql locally and they work fine. I can add, delete, view and edit records perfectly. There are 3 of these files and they all work the same. The add function looks like this...
//now perform the add routine
function add2SQL() {
//additional var to save not already posted from the form
$change_requestor=$_SESSION['fullname'];//default user
$change_status= "New Request";/default status
$today = date("d-m-y");//default entry date
include '../config.php'; //connect to the database
//8 fields and 8 values
mysql_query("INSERT INTO change_log (request_date, change_headline, change_description, change_reason, change_priority, change_requestor, change_type, change_status) " .
"VALUES ('$today', '$_POST[change_headline]', '$_POST[change_description]', ".
"'$_POST[change_reason]', '$_POST[change_priority]', '$change_requestor', ".
"'$_POST[change_type]', '$change_status')");
}
The 3 scripts are identical except for the database table name and, of course, the fields.
So I have publised this now to my server and for some reason 1 script works and 2 do not. The 2 that do not work give back no error message (error_reporting = E_ALL & ~E_NOTICE) - the data simply does not add to the DB. The list, update and delete works on all scripts so I know that the databases work fine. I've echo'd the values back and they are all correct too - session vars are present but the record simply won't add to my tables.
I've been on this now for 2 days and I simply can't figure out what's wrong. Any one spot anything obvious or know of a way I can trace what's happening please?