I have the following MySQL
$tutorial = $database->query(
'SELECT ' .
'tutorial.*, ' .
'apps.*'.
'FROM ' .
$database->db_prefix . 'tutorial, ' .
$database->db_prefix . 'apps ' .
'WHERE ' .
'apps.title = "' . $name . '" AND apps.id = tutorial.app AND tutorial.relation = "' . $user['id'] . '"'
);
I want to get the row where apps.title is equal to $name and then get all tutorials based on that retrieved apps id. This acts as a link between the two tables.
Is the above going to work?
in particular:
'apps.title = "' . $name . '" AND apps.id = tutorial.app AND tutorial.relation = "' . $user['id'] . '"'
From the query you posted above, I think you can
JOINthe two tables using theappfield something like:Or: