Well, In mysql database there 2 table.
a) users table structure
------------------------
id user_email
------------------------
1 [email protected]
2 [email protected]
3 [email protected]
6 [email protected]
7 [email protected]
9 [email protected]
b) user_property
-------------------------------------------------------------------------------------------
property_id user_id pcode pvalue paddress psuburb creation_date
-------------------------------------------------------------------------------------------
10 1 11205 $100 address suburb 10-02-2014
11 2 11205 $100 address suburb 10-02-2014
12 3 11205 $100 address suburb 10-02-2014
13 10 11205 $100 address suburb 10-02-2014
14 12 11205 $100 address suburb 10-02-2014
So in users table there are user email address exists. So I want to get few user_property table data with email address from users table. But how do I get it with a single mysql query ?
$sql = mysql_query("select user_id, postcode, paddress, psuburb, pvalue, creation_date FROM
user_property ORDER BY property_id DESC");
In my users table email address field name is user_email and id field name is id.
JOIN
? – Mr. Alienhttp://www.w3schools.com/sql/sql_join.asp
– Krofz