0

Im very new to PHP and MYSQL so forgive me if my question sounds funny.

I have three MYSQL Tables, tbl_supplier, tbl_orders and tbl_payments.

I was able to successfully run a query to show which orders from a particular supplier has not been paid yet. What I want to do now is select the orders that will be paid and pass them to another Php which will print only the selected orders. I have been searching around the net and my best bet is using an array on the Where clause of my SQL Statement. However, I am confused on how to do it.

(P.S.) I am not yet allowed to post an image.

I can put a checkbox on every row to mark it as selected and then a button at the button that says, "PAY SELECTED".

When I click "PAY SELECTED", my code should get all selected invoices, query the database for the details of each item selected and return the values.

I would really appreciate your help.

rainbasa
  • 69
  • 8
  • Can you share the `CREATE` statements for each of your three tables? – Zach Rattner May 16 '14 at 05:09
  • Im not sure what you mean by create statements. If you mean the MYSQL create statement, i dont think i have it because i created the table using phpmyadmin in XAMPP – rainbasa May 16 '14 at 05:17

1 Answers1

0
FROM invoices i
WHERE i.ORDER_ID IN (1,2,...100) 

all the selected order ids here

StanislavL
  • 56,971
  • 9
  • 68
  • 98
  • This is actually what i am rooting for however, how can i put the order id's inside the () without typing them one by one. Can i not have PHP or other script get the ID's of the orders selected, put them in an array and then pass them on to the WHERE clause? – rainbasa May 16 '14 at 05:25
  • http://stackoverflow.com/questions/907806/php-mysql-using-an-array-in-where-clause or http://stackoverflow.com/questions/7298216/passing-a-php-array-into-an-sql-query – StanislavL May 16 '14 at 05:27