Mutiple Table Queries in SQL and PHP

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

I need to get some data from multiple tables using a query so that I can then output this data on the page.

The querys need to do the following.

Select * from events SORT by id ASC limit 4
Select * from flyers where eventid = "id" (the id above)

Now the hard part is combining the 2 into one query. So that I can print the results out together, as I need to place the data in a repeat region.

Hope this makes sense, as i suspect it may not lol

Thanks
Aaron
 
Hi guys

This is my sql query. I have had to do some date formatting in the query

Code:
SELECT events.id, events.EventName, events.imageurl, flyers.ID, flyers.Flyername, flyers.ImageUrl, DATE_FORMAT(events.EventDate,'%W %D %M %Y')
FROM events, flyers
WHERE events.imageurl=flyers.id
ORDER BY events.id ASC

When I test the query in Dreamweaver it outputs the correct date, but I just cant get it to output in on the page

This is the echo that I am using
Code:
<?php echo $row_recEvents['DATE_FORMAT(events.EventDate']; ?>
I get nothing

PLease help :(

Ta
Aaron
 
Back
Top Bottom