salve, chi è che mi dice dove si trova l'errore?
Sto imparando ad usare pdo e sto creando un piccolo progetto utile..ma non so il motivo perché
mi da errore sintassi quando creo le tabelle a runtime con codice php.
errore:
che è ???
grazie mille.
Sto imparando ad usare pdo e sto creando un piccolo progetto utile..ma non so il motivo perché
mi da errore sintassi quando creo le tabelle a runtime con codice php.
PHP:
<?php
include("inc.php");
?>
<?php
$pdo->query("CREATE TABLE IF NOT EXISTS primanota (
id int unsigned auto_increment,
int giorno,
int mese,
int anno,
descrizione text,
importo_cassa float,
importo_banca float,
data datetime,
_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY ('id')) ENGINE = MyISAM DEFAULT CHARSET=utf8;
");
?>
errore:
Codice:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'int giorno, int mese, int anno, descrizione text, importo_cassa float, ' at line 3' in D:\xampp\htdocs\PrimaNota\setup\create.php:16 Stack trace: #0 D:\xampp\htdocs\PrimaNota\setup\create.php(16): PDO->query('CREATE TABLE IF...') #1 {main} thrown in D:\xampp\htdocs\PrimaNota\setup\create.php on line 16
che è ???
grazie mille.