Wednesday, 26 June 2013

Improved getting spot data

Now when getting spot data it will return the usual spot data plus an extra field that specifies if the user has added this spot to their favored spot list.

Using this query :
$q = "select *,(select COUNT(*) from favourites f  where f.userID='".$this->db->escape_str($ID)."' AND f.PlaceID=p.ID) as fav from place p order by p.DateFound desc";

it will return spot data plus create a new field that will compare the spots with the favorites table checking that certain user has liked this spot. it will set the fav filed to 0 if not added to their list or 1 if they have liked it.

This has now been applied to the Client and the appropriate action and icon will appear depending on the fav field of the spot data returned.

No comments:

Post a Comment