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