nick_escu Posted June 1, 2010 Share Posted June 1, 2010 Hi,If anyone could help me with a php script/file for the following sql query, I would be very grateful:SELECT product_name, SUM(product_quantity) FROM ps_order_detailWHERE (id_order>XXX AND id_orderTTT AND id_order<>VVV AND id_order<>.......)GROUP BY product_namewhere XXX, YYY, TTT, VVV,.... are user's input (in a form maybe). Orders will be considered from XXX to YYY excepting TTT, and VVV and ....TTT and VVV and... are canceled orders (or orders I do not want to consider for some reason).I don't know php (I'm trying to learn now) and I've seen that there are some issues with security (something with sql injection).I'm using the query above in phpmyadmin for now and it's ok, but I'm trying to improve and learn.Thank you, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now