I have a database named prestashop, a table ps_product and a field mq which is tinyInt.
If I do this query on console, it runs correctly, editing the value of a field in a record:
USE prestashop UPDATE ps_product SET mq = 0 WHERE id_product = 1
If I do this query programmatically (php):
mysql_query("USE prestashop 
                        UPDATE ps_product 
                        SET mq = 0 
                        WHERE id_product = 1;")
            or die("Query non valida: " . mysql_error());
and this is the error:
Query non valida: 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 'UPDATE ps_product SET mq = 0 WHERE id_product = 1' at line 2
why? In the console all proceeds correctly, and it really edit the value on the table
 
     
    