tags:

views:

25

answers:

1
+2  A: 

mysql_query() sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier.

Youll have to grab all your posts (or a batch of them) and store the ids or whatever other data you need into an array or object and then iterate over it making the appropriate query and displaying output.

Or you could use some sql like this:

SELECT thank_you.* FROM thank_you, post WHERE post.id = thank_you.post_id ORDER BY thank_you.post_id;

Of course with this you lose grouping youd have to add some extra logic to build the proper presentation structures based on if the post_id has changed within the loop.

prodigitalson
Thank you for the answer to my question and the added implementation suggestion. :-) I feel kind of silly for not spotting that when I browsed the php documentation.
John
Its cool.. actually i would **REALLY** recommend not using the `mysql` library - use `pdo_mysql` or `mysqli` instead assuming they are available on the server youre deploying to... but they should be in this day and age. If not id switch hosts. Just my opinion :-)
prodigitalson
If you really can't use anything but the mysql_* functions, you could always open two connections to the database. 1st connection does the outer loop, 2nd connection does the inner loop. But still, you'd be better off with PDO/mysqli
Marc B