Trying to query 2 tables?
I was wondering if someone can help me with my query.
This is my query that works great:
$query = sprintf("SELECT primary_key, address, postcode, lat, lng, ( 3959
* acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng )
- radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS
distance FROM stores HAVING distance < '%s' ORDER BY distance LIMIT 0 , 5"
I also need to retrieve data from a table called products; the primary
key, col1 and col2. The primary key being the common field.
How would I add to this query? Hope someone can help me?
Many thanks
No comments:
Post a Comment