Using PHP Object with SQL Query
Posted on 2014-09-13
I've got a User form, upon submission, it consumes a web service, and the response is a contract vehicle.
This is the returned object:
stdClass Object ( [contractVehicle] => Array (  => ITCommodityProgram ) )
There are several contract vehicles.
I then need to use the returned contract vehicle, query my Products table like so:
SELECT * FROM `product` WHERE `contract_vehicle` = 2
The important point is the WHERE needs to be dynamic, , not hard coded, because the returned contract vehicle will be different with each User submission.