Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: How can I multiple foreach loopdata in same loop

test131:

How can I fetch data

1 user can many item

1 item can add many Status item

User


|---------------------|------------------|
| id | name |
|---------------------|------------------|
| 1 | TESTNAME |
|---------------------|------------------|

ITEM


|---------------------|------------------|
| Item_id | name |
|---------------------|------------------|
| 1 | ITEM1 |
|---------------------|------------------|

STATUS


|---------------------|------------------|------------------|
| status_id | name | item_id |
|---------------------|------------------|------------------|
| 1 | status1 | 1 |
|---------------------|------------------|------------------|

USER_ADD_ITEM


|---------------------|------------------|------------------|
| User_item | user_id | item_id |
|---------------------|------------------|------------------|
| 1 | 1 | 1 |
|---------------------|------------------|------------------|

I try to Loop data by


my sql = SELECT * FROM USER_ADD_ITEM a
LEFT JOIN USER u ON a.user_id = u.id
LEFT JOIN ITEM i ON a.item_id = i.id
LEFT JOIN STATUS s ON a.item_id = s.item_id

I'm confusing now did my database right? how can I loop data with have status inside loop



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: How can I multiple foreach loopdata in same loop

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×