Hi all:
I have a question regarding data insertion into DB and the order of variable. 🙂
I'm using a code like this to insert data:
$sql = mysql_query("INSERT INTO Products (ProductID, ProductName, ProductPrice,ProdDesc) VALUES (NULL, $Name,$Price,$Desc);
...
The code works fine and everything does go through.
However the problem occurs when I change the order of fields in the form.
For example as long as name, price, description appear on the form in that order things are perfect, but when I move one nothing works.
Any suggestions?
Also, if I recall correctly, there is another method to insert data, in pairs,like this :
$sql = mysql_query("INSERT INTO Products ProductID(NULL), ProductName($ProductName) .........
Is this correct? What's the right syntax?
Thanx in advance.
Kamy