这是因为数? 应该等于USING
子句后的参数数量。你也给出了错误的报价?而不是"?"
尝试:
PREPARE STMT FROM 'SELECT a, b, c, d, e FROM TABLE_1 WHERE (`a` like "%?%" OR `b` like "%?%" OR `c` like "%?%" OR `d` like "%?%" OR `e` like "%?%") LIMIT ?, ?';
EXECUTE STMT USING @search, @search, @search, @search, @search, @skip, @rows;
或尝试
SET @query1 = CONCAT('
SELECT SQL_CALC_FOUND_ROWS a, b, c, d, e
FROM TABLE_1
WHERE (`a` like "%',@search,'%" OR
`b` like "%',@search,'%" OR
`c` like "%',@search,'%" OR
`d` like "%',@search,'%" OR
`e` like "%',@search,'%")
LIMIT ',@skip,', ',@rows,'');
PREPARE stmt FROM @query1;
EXECUTE stmt;
SELECT FOUND_ROWS() AS total_rows;
DEALLOCATE PREPARE stmt;