I’m trying to make it so I can find people with a certain zipcode but list the results by their full name in ASC order under the users table…
SELECT profiles.id
FROM `profiles`,`users`
WHERE profiles.zipcode = '$ZIPCODE'
ORDER BY users.full_name ASC
It like shows doubles.
You need a join I think, try something like
I assume there is a foreign key for users in the profiles table? The answer assumes a foreign key of user_id in the profiles table
EDIT:
A foreign key is a key belonging to another table. So if you have a user and a profile table, you would most likely have a column in the profile table, that for each profile references a unique users (assuming users only have 1 profile each)