mysql> select t1.p from (select path_id p from pathway where content = 'a') t1, (select path_id p from pathway where content='b') t2 where t1.p = t2.p;
+------+
| p |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
$from_to_sql = "select PATH_ID from pathway p1,pathway p2
where p1.PATH_ID=p2.PATH_ID
and p1.CONTENT='".$content_get1."'
and p2.CONTENT='".$content_get2."';";
为什么我执行的时候还是有问题
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pwps\from_to.php on line 12
路径共有条
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pwps\from_to.php on line 14