MySQL
tablo1:
+--------+------+
| listid | type |
+--------+------+
|    1   |  a   |
+--------+------+
|    2   |  a   |
+--------+------+
|    3   |  b   |
+--------+------+
Tablo2:
+----+--------+------+
| id | listid | code |
+----+--------+------+
|  1 |    1   |  ax  |
+----+--------+------+
|  2 |    1   |  bx  |
+----+--------+------+
|  3 |    2   |  ax  |
+----+--------+------+
|  4 |    2   |  bx  |
+----+--------+------+
|  5 |    2   |  cx  |
+----+--------+------+
|  6 |    3   |  ax  |
+----+--------+------+
|  7 |    3   |  bx  |
+----+--------+------+
Task
Bir sorguda, eğer ben kontrol etmek istiyorum:
1) tabloda table2 sadece "balta" & "Bx" code olarak listelenen
2) listid Ben 1 olsun) türü "bir" tablo table1 olduğunu
PHP
$a = mysql_query("SELECT t1.listid FROM table1 AS t1, table2 AS t2......");
$b = mysql_fetch_assoc($a);
if($b['listid'])
{
    echo $b['listid'];
}
else
{
    echo 'nothing found';
}
Output
listid = 1
"cx" de table2 dahil olduğundan ListId = 2, yanlış
o table1 "b" yazın çünkü ListId = 3, yanlış
Bu mantıklı umut :)
