我有一個當前可用的查詢,但我們增加了一個客戶做多個測試驅動的可能性。這個額外的測試驅動器在不同的桌子上。客戶ID是testdriveform表上的自動增量編號。因此,我需要根據表2中表1的客戶ID檢查添加條目,並與其餘部分一起列出。在mysqli中使用子查詢
SELECT * FROM testdriveform Where SalesAgent not like '%Test%' and SalesAgent like '%$Sales%' and Date between '$sDate' and '$eDate' and Stock != '' order by Date, SalesAgent;
我需要添加一個子選擇,我認爲。增加的東西
SELECT * FROM testdrives WHERE custID = testdriveform.id
phpmyadmin在bluehost..again下。任何人?
我想你只需要'JOIN'這兩個表 –