two queries on two tables on one page
Posted: Tue Aug 19, 2008 8:25 am
Hi there,
Basic question I'm sure but how do I do two queries on two different tables on the same page?
Basically I've got a news page where people can leave comments.
The first query gets the story from the 'news' table and then below that a second query retrieves the comments posted from the 'comments' table.
Well, thats what I want, but it won't let me!
The problem seems to be putting the results of the second query into an array (mysql_fetch_array).
Incedently it works fine if the second query retrives data from the same table as the first, but that's not what I need!
Anyway I'm sure it's something simple I'm not doing right.
Thanks in advance.
Basic question I'm sure but how do I do two queries on two different tables on the same page?
Basically I've got a news page where people can leave comments.
The first query gets the story from the 'news' table and then below that a second query retrieves the comments posted from the 'comments' table.
Well, thats what I want, but it won't let me!
The problem seems to be putting the results of the second query into an array (mysql_fetch_array).
Incedently it works fine if the second query retrives data from the same table as the first, but that's not what I need!
Anyway I'm sure it's something simple I'm not doing right.
Thanks in advance.