$query =
"
SELECT * FROM platoon_members m
INNER
JOIN users u
ON u.UserID = m.UserID
WHERE m.platoon_id = {$row['id']}
ORDER
BY u.rank ASC";
And it produces:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 62
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 66
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 62
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 66
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 62
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 66
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 62
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 66
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 62
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/benanddale/domains/nsgclan.com/public_html/includes/Regiment.php on line 66
step 1 - develop a working query using something like phpmyadmin, mysql workbench, heidisql, or another similar tool. Don’t stop until you have a query that produces the desired result set.
step 2 - using the working sql query you created, create a string in php, substituting any variables needed. echo the text to the screen.
step 3 - make sure it matches the working sql query you created
step 4 - now you can actually query the database from within php.