我在从数据库中选择数据时遇到问题。它向我显示以下错误
A Database Error Occurred
Error Number: 1054
Unknown column 'BA' in 'where clause'
SELECT * FROM crime_details INNER JOIN crime_slink ON crime_slink.report_ID =crime_details.report_ID INNER JOIN crime_suspect ON crime_suspect.id=crime_slink.suspect_id INNER JOIN crime_vlink ON crime_vlink.report_ID=crime_details.report_ID INNER JOIN crime_victim ON crime_victim.id=crime_vlink.victim_id WHERE crime_details.report_ID =BA-12-00002
Filename: C:\xampp\htdocs\CNPPO\system\database\DB_driver.php
Line Number: 330
似乎问题出在这部分 WHERE crime_details.report_ID =BA-12-00002
我认为问题是由我的查询中的破折号或连字符引起的。我使用$this->db-query()
codeigniter 的功能进行查询。