I have a mysql join query for retrieving the users a user subscribed to.
SELECT * FROM (subscriptions) JOIN users ON users.userid = subscriptions.following WHERE userid = $userid ORDER BY subscribed desc
In order to ensure that the query is correct, is there a php function that I can use to see what I produced? Maybe get a table structure of the query like below. Or is there another way to get a visual table design of my join?
+----+-------------+-------------------+
| ID | some column | some column |
+----+-------------+-------------------+
| 1 | 102 | 213 |
| 2 | 64 | 23 |
| 3 | 4 | 344 |
+----+-------------+-------------------+
EDIT: It seems that I can test the query in phpmyadmin which produces a table of my join query. This is a great way to get a visual of your query!
Not necessarily a single function, but you can create yourself one using:
mysql_fetchassoc()to get the resultset as key(col name)/value(col value) pairsarray_keys()to get all the column names from resultset and create your table header