I am writing a few scripts for an internal CMS for my employer it is only basis but gets rid of loads of nasty excel spreadsheets and it gives more flexibility & options.
The problem I have today is that I have a script that writes to the database based upon a userform input.
I have done this successfully for a table called customers but I am trying to create one called ncr but for some reason the script runs but no information gets input into the database.
NCR: input type="text" name="NCR"
Project: input type="text" name = "Project"
Raised By: input type="text" name = "Raised"
Date: input type="text" name = "Date"
Pasts Affected: input type="text" name = "Parts"
Description: input type="text" name = "Description"
Corrective Action Taken: input type="text" name = "Action
Components Returned to Spec: input type="text" name = "Rtn_Spec"
Concession Applied For: input type="text" name = "Concession"
Corrective Action Approved By: input type="text" name = "CR_By"
Reviewed For Preventative Actions By: <input type="text" name = "Review_By"
Preventative Actions Taken: input type="text" name = "Actions_tk"
Preventative Actions Approved By: <input type="text" name = "Actions_Apr"
NCR Closed Out?: input type="text" name = "Closed"
Date Closed: input type="text" name = "Date_Clsd"
Closed Out By: input type="text" name = "Clsd_By"
This is my script
$NCR=$_POST['NCR'];
$Project=$_POST['Project'];
$Raised=$_POST['Raised'];
$Date=$_POST['Date'];
$Parts=$_POST['Parts'];
$Descr=$_POST['Descr'];
$Action=$_POST['Action'];
$Rtn_Spec=$_POST['Rtn_Spec'];
$Concession=$_POST['Concession'];
$CR_By=$_POST['CR_By'];
$Review_By=$_POST['Review_By'];
$Actions_tk=$_POST['Actions_tk'];
$Actions_Apr=$_POST['Actions_Apr'];
$Closed=$_POST['Closed'];
$Date_Clsd=$_POST['Date_Clsd'];
$Clsd_By=$_POST['Clsd_By'];
// (database connection details go here)
mysql_query(
"INSERT INTO 'ncr'
VALUES ('$NCR', '$Project', '$Raised',
'$Date','$Parts', '$Descr',
'$Action', '$Rtn_Spec', '$Concession',
'$CR_By', '$Review_By', '$Actions_tk',
'$Actions_Apr', '$Closed', '$Date_Clsd',
'$Clsd_By')
");
Print "Your information has been successfully added to the database.";
Any help would be appreciated
$result = mysql_query(...) or die(mysql_error()).