Estoy con un problema hace ya unas horas y sigo sin resolverlo...
Estoy haciendo un insert al estilo update (con set), el tema es que me sale el siguiente error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set `id_user`=, `id_ticket`=, `fecha`=, `hora`=, `mail_op`=, `mensaj' at line 1
Código PHP:
$query_tickets_insertar="
INSERT INTO ".$config['tabla_tickets_users']." set
`id_user`=".$g_id_user.",
`id_ticket`=".$g_id_ticket.",
`fecha`=".$g_fecha.",
`hora`=".$g_hora.",
`mail_op`=".$g_mail_op.",
`mensaje`=".$g_mensaje;
Código PHP:
$query_tickets_insertar="
INSERT INTO ".$config['tabla_tickets_users']." set
`id_user`='$g_id_user',
`id_ticket`='$g_id_ticket',
`fecha`='$g_fecha' ,
`hora`='$g_hora' ,
`mail_op`='$g_mail_op',
`mensaje`='$g_mensaje'
";
Código PHP:
$query_tickets_insertar="INSERT INTO ".$config['tabla_tickets_users']."
(id_user, id_ticket, fecha, hora, mail_op, mensaje) VALUES
($g_id_user, $g_id_ticket,$g_fecha, $g_hora, $g_mail_op, $g_mensaje)";