I have two tables (claim_pics & claiminfo) I am doing a query for a results page.
Its works well.. when there there is a match of the two tables claim_id ( claiminfo.claim_id = claim_pics.claim_id ).
However when there there is only one table with a claim_id, namely in claiminfo, and not a matching claim_id, all of the attributes of the row show up except the claim_id.
There is no claim_id, so if a user clicks an edit button, there is no claim_id to tell it where to go.
I need it present the $results of the claim_id regardless is there is a match or not. Any ideas or work arounds?
Thanks.
$query = "SELECT * FROM claiminfo
LEFT JOIN ( claim_pics )
ON ( claiminfo.claim_id = claim_pics.claim_id )
WHERE( userid='$userid' )
ORDER BY claiminfo.ts
DESC LIMIT 200";
// Will only return
claim_ids that both pics and info match
$result = mysql_query( $query );
while( $row = mysql_fetch_assoc( $result ) ) {
$namelocation = $row['namelocation'];
$claimholder = $row['claimholder'];
$occasion = $row['occasion'];
$geotag = $row['geotag'];
$lat = $row['lat'] ;
$lng = $row['lng'];
$claim_id = $row['claim_id'];
$img = $row['location'];
$html = " ... "