2
I don’t know what’s going on but my code doesn’t work it is simply not entering data into the table
<?php
include "../../lib/inc_con.php";
session_start();
$mesa = $_POST['mesa'];
$tamanho = $_POST['tamanho'];
$quantidade = $_POST['qtd'];
$add = $_POST['add'];
$hiddentotal = $_POST['hiddentotal'];
$data = date('Y-m-d H:i:s');
$produto_id1 = $_POST['produto_id1'];
$atendente_id = $_SESSION['id'];
$sql = mysql_query("INSERT INTO pedidos (mesa, tamanho, qtd, add, hiddentotal, data, produto_id1, atendente_id) values ('$mesa', '$tamanho', '$quantidade', '$add', '$hiddentotal', '$data', '$produto_id1', '$atendente_id')") or die (mysql_error());
?>
if necessary here is my table
And here’s the error that’s showing on the screen
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 'add, hiddentotal, date, producto_id1, atendente_id) values ('6', '14.25', '2', '1' at line 1
by error message you cannot deduce anything?
– Daniel Omine
After a look at this post : http://answall.com/questions/579/por-que-n%C3%A3o-should-use-fun%C3%A7%C3%B5es-type-mysql
– Gabriel Rodrigues
use mysqli_* or PDO, mysql* is being discontinued in new versions of PHP 5.4.
– Ivan Ferrer
If you decided not to forget to accept the answer that was most useful to you, also see How and why to accept an answer?
– rray