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!
mysql>command line?mysql -u username -p. You'll be prompted for your database password. Thenuse dbname;Then type your query and see what scrolls across your screen.