The query below works well. Now I would like to add another table called addresses, which contains the same submissionid
and zip
variables below. I would like to pull all the submissionid
variables from addresses where zip = '$zip'
, then use these results to look up the corresponding title
rows from the submission table in the query below.
$sqlStr = "SELECT title, points, submissionid
FROM submission
WHERE zip = '$zip'
ORDER BY points DESC, title ASC
LIMIT $offset, $rowsperpage";