I have a page which is suppose to show information from the database with multiple tables.
How do i use join for these 2 tables to show the info on one page?
Here is my original code:
Code: Select all
$result = mysql_query("SELECT * FROM list",$db);
while ($info = mysql_fetch_array($result))Code: Select all
echo $info['name'];Just in case you're wondering this is not the full code...
it works just fine.
Now if i wanted to get the info from 2 tables i tried:
Code: Select all
$result = mysql_query("SELECT * FROM list,cities WHERE cities.id list.id=$id",$db);
$info = mysql_fetch_array($result);Maybe something like this
Code: Select all
echo $info['cities.id'];