I am populating a table using PHP / MySQL.
It displays the classification id instead of the classification name so I need to cross reference the classifications table to obtain the name.
Now I can do this within the loop for each row in the table by adding a MySQL query such as "SELECT classification_name from classifications WHERE classification_id = $row['classification']";
I feel this would cause unnecessary strain on SQL as for a large number of rows I’ll be initialising a lot of SQL queries.
I can bring the classifications table into a PHP array and cross reference it but is there an easier way to cross reference two sets of SQL data (with one outside of the loop).
I think I am being daft as I’m sure there is an easier method I have used in the past.
Thanks in advance.
This should be done in a query using a
JOIN; getting information this way using PHP would be incredibly inefficient for your system.