Multiplying all Integers in a mysql select

Ok so what i want to do is kind of like this…

$quantity=4 //this is an example. the actual quantity will be retrieved from a $_POST
$record=“SELECT * FROM product_specs WHERE product=’$product’ and is NOT NULL then multiply each field by $quantity then INSERT INTO production”;[/php]

i know that isnt the correct syntax but i am not quite sure what to do.

the numbers in the product_specs table are basically a table of the raw material/quantities that make up the product. the table only has the quantities it would take to make one. so when we produce, 7 i need the production table to read like the (product_specs * 7). both tables have identical columns. no ID or AI.

You need to do your math in a while statement after you have called your query.

Sponsor our Newsletter | Privacy Policy | Terms of Service