I'm trying to rebuild my php/mysql website with mysqli methods. I would to insert a new record in my table SEZIONE, it attributes are:
ID_STAGIONE number (primary key),
ORDINE number,
TITOLO varchar(100),
PUBBLICO varchar(1)
I build dinamically my query, and after i execute it with this istruction:
$db->query($query);
It doesn't work. I decided to print the value of the variable $query, and it is perfect:
insert into SEZIONE (ID_STAGIONE, ORDINE, TITOLO, PUBBLICO) values ('2', '20', 'prova', 'S')
If I execute the query in phpmyadmin sql terminal.. it work! I know that the fields ID_STAGIONE and ORDINE are numbers, so it's not necessary the character ', but it work in phpmyadmin sql terminal. There's anyone that can help me?!?
$db->query($query) or die(mysqli_error($db));
– Rajlaksh 2 days ago