Up until now I have just been using one table in a MySQL query, but now I am using two tables in a query to return only users’ favourites, i.e.:
$query1="SELECT tracks.id, favourites.track FROM tracks, favourites WHERE tracks.id = favourites.track";
$result=mysql_query($query1) or die(mysql_error());
I am wondering how then I would refer to columns in rows in just the tracks table to construct variables from this query. Previously I used:
while ($row = mysql_fetch_array($result)) {
$title = $row['title'];
...etc
}
But obviously this needs adapting to refer to just the rows in the tracks table, but how do I do this?
You can do the same using: