|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 | |||||||||||||
|
Resident Slacker
Join Date: Dec 2001
Location: Suisun City, California (i know, where the hell is that?!?!?)
Posts: 2,620
|
looping a mysql query with php
hey everyone,
i'm still pretty new to using sql with php and i need some help. what i need is to have some html tables built automatically off of two mysql tables. mysqltable_1 includes dates and some basic header information for each date mysqltable_2 has events that occurred on each date, multiple events for each date i want the html table to contain the header information for each date, and the rows beneath it to list the event, and i want it to keep building tables until the first mysqltable_1 no longer has any new dates. example:
what i thought might work follows (replace the ^ with ><'s): Quote:
__________________
Friends help you move. REAL friends help you move bodies. - me quite possibly the best book ever written... by me |
|||||||||||||
|
|
|
|||||||||||||
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
If I understand your post correctly, what you want to do can be achieved by joining the two tables, something like:
Code:
SELECT * FROM mysqltable1, mysqltable2 WHERE mysqltable1.date = mysqltable2.date http://dev.mysql.com/doc/mysql/en/join.html I may be able to help more if you post the structure of the tables. HTH EDIT: BTW you can use [ php ] [/ php ] tags to post PHP code without having to replace < and >. Last edited by aym; 06-22-2005 at 05:06 PM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|