Unanswered: Access SQL to MySQL Inner Join Problem
Here is a Access SQL query for use with a MySQL database:
$sql = 'SELECT table1.*, table2.*, table3.* FROM table3 INNER JOIN (table1 INNER JOIN table2 ON table1.ID_No = table2.ID_No) ON table3.Cust_No = table2.Cust_No WHERE (((table1.Name) Like "%Hofman%")) ORDER BY table1.Name LIMIT 0,10';
I can't get this working using Apache / PHP, the page just keeps loading and slows my PC down tremendously. It has no problems with a query with just two tables out of three.
table type possible_keys key key_len ref rows Extra
table3 ALL Cust_No NULL NULL NULL 125
table1 ref ID_Cust,Cust_No,ID_No Cust_No 4 table3.Cust_No 3571 Using where
table2 ref ID_No ID_No 6 table1.ID_No 1 Using where
What can I learn from this? Something is wrong with table 3? It has a possible key, then why doesn't it use it?
Also, why is the suggested nr of rows is completely wrong?