Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

many to many getting data mysql

SELECT u.*, s.*
FROM users AS u
INNER JOIN users_states AS us ON u.user_id = us.user_id
INNER JOIN states AS s ON us.state_id = s.state_id
WHERE s.state_id = ?
ORDER BY u.name ASC
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #data #mysql
ADD COMMENT
Topic
Name
5+9 =