Expand|Select|Wrap|Line Numbers
- users
- ------
- id
- ....more columns
- users_profiles
- --------------
- users_id
- ...more columns
I need to querry from users, get it's match in users_profile and display the reults in php page.
This is what I got so far, but the result page is blank.
Expand|Select|Wrap|Line Numbers
- // Make a MySQL Connection
- // Construct our join query
- $query = "SELECT users.id, users_profile.users_id FROM users, users_profile WHERE users.id = users_profile.id";
- // SELECT table1.column1, table2.column2 FROM table1, table2 WHERE table1.column1 = table2.column1;
- $result = mysql_query($query) or die(mysql_error());
- // Print out the contents of each row into a table
- while($row = mysql_fetch_array($result)){
- echo $row['id']. " - ". $row['users_id'];
- echo "<br />";
- }