選擇

2016-01-20 36 views
-2

這是在AM試圖做表A的所有職業類別&表B有用戶細節了要從2個表中選擇和匹配類別中選擇,如果用戶從選擇「Web開發人員」下拉類別。我想顯示Web開發者下的用戶列表。選擇

<?php 
$q = intval($_GET['q']); 
//select state of the two tables here 
$result = mysqli_query($con,$sql); 
while($row = mysqli_fetch_array($result)) { 

?> 
/// 
<?php }?> 
+0

檢查你的問題。 – AnkiiG

+0

從2個數據庫或2個表中選擇相同的數據庫? – RamRaider

回答

0

這是從這個問題不明確和缺乏數據庫的詳細介紹是什麼以及如何做SQL查詢(我認爲這是什麼,你實際上是要求),但沿也許這些路線的東西。

select * from `tableB` b 
    left outer join `tableA` a on a.`professionid`=b.`professionid` 
    where a.`profession`='Web Developer'