This topic is locked
[SOLVED]

 Invoice Template: Error To Add In Another Table

3/6/2013 9:39:16 PM
PHPRunner General questions
J
joiresende author

hello

In invoice template want to add the data in another table.

for so I am using the code before the data recorded on page invdetails.Entretanto always gives error.

What could be going wrong?

the code is:
global $conn;

CustomQuery("UPDATE anotherTable set 'stok' = quantidade + ". $values["quantity"].",

'Price1' = ".$values["price"].", where barcode = " .$values["barcode"]);

return true;

Sergey Kornilov admin 3/6/2013

What is the error message?

J
joiresende author 3/7/2013

Erro256

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 '' at line 1

Sergey Kornilov admin 3/7/2013

Try to print your query instead of executing it to see what's wrong with it.
Instead of

CustomQuery("UPDATE anotherTable set 'stok' = quantidade + ". $values["quantity"].",

'Price1' = ".$values["price"].", where barcode = " .$values["barcode"]);


use

echo "UPDATE anotherTable set 'stok' = quantidade + ". $values["quantity"].",

'Price1' = ".$values["price"].", where barcode = " .$values["barcode"];

exit();
J
joiresende author 3/8/2013

Thanks for the support.

After replacing the double quotes (") by single quotes (') worked perfectly. Was also the most a comma.