Inserting Product in database
Posted: Mon Jul 31, 2006 5:59 pm
Hello ppl!
I need help, i'm building a form and processing him by php script. the form consist in 6 fields.
in the php script i've already catch all the variables (i try it to print them and i know i have the values in the correct variables) but i'm not understand why the insert statement didn't work someone could help me?
Here is the php code i'm using to do the insert:
$sql = 'INSERT INTO `Produtos` (`ID`, `Nome`, `Descricao`, `Categoria`, `Preco`, `Num_img`) VALUES ('.$id.','.$nome.','.$descricao.','.$categoria.','.$preco.','.$num_img.');';
What i'm doing wrong?
I've tried to insert values instead of my variables and work! What is worng with my variable?
With the best regards
Hugo Gomes
I need help, i'm building a form and processing him by php script. the form consist in 6 fields.
in the php script i've already catch all the variables (i try it to print them and i know i have the values in the correct variables) but i'm not understand why the insert statement didn't work someone could help me?
Here is the php code i'm using to do the insert:
$sql = 'INSERT INTO `Produtos` (`ID`, `Nome`, `Descricao`, `Categoria`, `Preco`, `Num_img`) VALUES ('.$id.','.$nome.','.$descricao.','.$categoria.','.$preco.','.$num_img.');';
What i'm doing wrong?
I've tried to insert values instead of my variables and work! What is worng with my variable?
With the best regards
Hugo Gomes