SQL LIKE query failing - fatal error in prepared statement
问题 I have the following code: $countQuery = "SELECT ARTICLE_NO FROM ? WHERE upper(ARTICLE_NAME) LIKE '% ? %'"; if ($numRecords = $con->prepare($countQuery)) { $numRecords->bind_param("ss", $table, $brand); $numRecords->execute(); $data = $con->query($countQuery) or die(print_r($con->error)); $rowcount = mysql_num_rows($data); $rows = getRowsByArticleSearch($query, $table, $max); $last = ceil($rowcount/$page_rows); } Which should work fine. However I receive the error that : You have an error in