Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

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.

share|improve this question
    
Can you share the CREATE statements for each of your three tables? – Zach Rattner May 16 '14 at 5: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 – user3643369 May 16 '14 at 5:17
FROM invoices i
WHERE i.ORDER_ID IN (1,2,...100) 

all the selected order ids here

share|improve this answer
    
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? – user3643369 May 16 '14 at 5:25
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.