1
我想提出一个搜索页面,我试图利用工会三个表选择计数,但我得到的错误是这样 Fatal error: Cannot pass parameter 2 by reference in /home/plooks/public_html/user/test.php on line 106here is my table structure
与工会表的SQL查询SELECT COUNT
表1名>>博文
| bid | title | body | author |
|----- |------- |------------- |-------- |
| 1 | new | hello new | you |
| 2 | cast | broadcast | me |
| 3 | hack | who hack us | you |
表2名>> forumnew
| fid | ftitle | fbody | user |
|----- |------- |------------- |-------- |
| 1 | new forum | hello new | you |
| 2 | cast me | broadcast | me |
| 3 | hack you | who hack him | us |
表3名>>下载
| did | file | disc | type |
|----- |------- |------------- |-------- |
| 1 | whoweare | hello new | php |
| 2 | cast | broadcast | html |
| 3 | hack | who hack us | c++ |
SQL查询
SELECT COUNT(id) FROM (
SELECT 'post' AS type, BID AS id FROM blogpost
UNION
SELECT 'jail' AS type, jid AS id FROM forumnew
UNION
SELECT 'article' AS type, TID AS id FROM download
)csl WHERE title LIKE :search OR title LIKE :search")
哪个表有description列? – artm
@artm我编辑了我的帖子 – Frank
你的代码是什么样的?类似的问题:http://stackoverflow.com/questions/8287581/how-to-resolve-cannot-pass-parameter-by-reference-error-in-php#autocomment44785441 – mulquin