Is the following a vaild query, or does any one have any suggestion on how to change it to get the correct info i'm looking for?
[CODE=mysql]
$Engineer = $_POST['Engineer'];
$Ref_No = $_POST['Ref_No'];
$query = "INSERT INTO engineer (Ref_No,Title,F orename,Surname ,Email,Branch,M essage,Severity ,Engineer)
VALUES('$Engine er')
SELECT Ref_No,Title,Fo rename,Surname, Email,Branch,Me ssage,Severity FROM new_fault
WHERE ref_no='$Ref_No '";
$result = mysqli_query($c xn,$query) or die ('error making query');
[/CODE]
The table im trying to put info in to is called engineer. I want to input the data from table New_Fault that contains the SELECT values (Ref_No etc) also i want to put in the engineer name from the POST method.
[CODE=mysql]
$Engineer = $_POST['Engineer'];
$Ref_No = $_POST['Ref_No'];
$query = "INSERT INTO engineer (Ref_No,Title,F orename,Surname ,Email,Branch,M essage,Severity ,Engineer)
VALUES('$Engine er')
SELECT Ref_No,Title,Fo rename,Surname, Email,Branch,Me ssage,Severity FROM new_fault
WHERE ref_no='$Ref_No '";
$result = mysqli_query($c xn,$query) or die ('error making query');
[/CODE]
The table im trying to put info in to is called engineer. I want to input the data from table New_Fault that contains the SELECT values (Ref_No etc) also i want to put in the engineer name from the POST method.
Comment