The query below returns rows that have both loginid
and ip2
in the bumps
table.
All rows in the bumps
table have ip2
, but only some have loginid
.
How can I get the query below to return ip2
for all rows and loginid
for the rows that have loginid
?
$sqlStrend = "SELECT e.loginid, e.time, l.username, e.ip2
FROM bumps e
JOIN login l ON e.loginid = l.loginid
WHERE e.submissionid = '$submissionid'
ORDER BY e.time DESC
LIMIT $offset, $rowsperpage";