我正在尝试在 HTML 表中的数据库中显示特定值。语句是这样的:(这只是一个例子)
$sql = "SELECT * FROM tbl_trainings WHERE tbl_trainings.training='Meat Processing'";
我的问题是我有这个声明(加入表):
$sql="SELECT
tbl_info.id,
tbl_info.firstname,
tbl_info.middlename,
tbl_info.lastname,
tbl_trainings.id,
tbl_trainings.training,
tbl_trainings.info_id
FROM tbl_info, tbl_trainings
WHERE tbl_info.id = info_id
ORDER BY tbl_info.id";
我试图WHERE tbl_trainings.training='Meat Processing'
在这样的语句中插入:
$sql="SELECT
tbl_info.id,
tbl_info.firstname,
tbl_info.middlename,
tbl_info.lastname,
tbl_trainings.id,
tbl_trainings.training,
tbl_trainings.info_id
FROM tbl_info, tbl_trainings
WHERE tbl_info.id = info_id, tbl_trainings.training='Meat Processing'
ORDER BY tbl_info.id";
但我得到了错误。错误是:
警告:mysql_fetch_array() 期望参数 1 是资源,在 C:\wamp\www\CLphpTest\meatproc.php 中给出的布尔值
谁能帮我纠正这个问题?(对不起。仍然是菜鸟)
提前致谢。