syntax error [closed]

1

What happens is that I'm trying to insert the data sent by php but I get syntax error:

  

on Tutela Poso no no 2018-02-14 112345 Clinical Society Emcosalud is still trying 98765432 Citizenship Card or problems in the selectYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on', 'on', 'on', 'Tutela Pos', 'on', '2018-02-14', '112345', 'Clinical Society Emcosalu' at line 4

this is the query:

<?php
$conexion=mysqli_connect("localhost","root","","bd_tickets")or
die ("problemas con la conexion");


$authorization = $_REQUEST['authorization'];
$type = $_REQUEST['type'];
$formula = $_REQUEST['formula'];
$history  = $_REQUEST['history'];
$document = $_REQUEST['document'];
$authorization_date = $_REQUEST['authorization_date'];
$document_number = $_REQUEST['document_number'];
$entity = $_REQUEST['entity'];
$authorization_number = $_REQUEST['authorization_number'];
$observations = $_REQUEST['observations'];
$document_type = $_REQUEST['document_type'];

echo $authorization, $type, $formula, $history, $document, $authorization_date, $document_number, $entity, $observations, $authorization_number, $document_type;

mysqli_query($conexion,

"INSERT INTO 
guardianship(type,authorization,formula,history,document,authorization_date,document_number,entity,
observations)
VALUES ($_REQUEST[authorization]','$_REQUEST[formula]','$_REQUEST[history]','$_REQUEST[type]','$_REQUEST[document]','$_REQUEST[authorization_date]','$_REQUEST[document_number]','$_REQUEST[entity]','$_REQUEST[observations]',NOW())") or

die ("problemas en el select".mysqli_error($conexion));
mysqli_query($conexion,"INSERT INTO medical_record(id,number,guardianship_id)
VALUES ('$_REQUEST[id]',
'$_REQUEST[number]',
'$_REQUEST[guardianship_id]'") or

die ("problemas en el select".mysqli_error($conexion))

//mysqli_close($conexion);

//echo'<script language="JavaScript"> alert("Registro Exitoso");</script>';*/
?>

this is the table

id 
type
authorization
formula
history
document
authorization_date
document_type
document_number
entity
observations
status
user
    
asked by Toli Soft 02.02.2018 в 16:25
source

1 answer

0

In addition to the previous comments, you have another fault, and that is that the fields of the insert do not correspond: INSERT INTO guardianship ( type , authorization, formula, history, document, authorization_date, document_number, entity, observations) VALUES ($ _REQUEST [authorization] ',' $ _ REQUEST [formula] ',' $ _ RE

You are missing the first type field in the values ...

    
answered by 04.02.2018 в 21:13