ผมใช้ prepare แล้วติด error Fatal error: Uncaught PDOException: SQLSTATE[07002]: [Microsoft][ODBC Driver 17 for SQL Server]COUNT field incorrect or syntax error in ผมพลาดตรงไหนไปอะครับ ขอบคุณล่วงหน้าครับ
Code (PHP)
$txtKeyword = "%".$_POST['txtKeyword']."%";
$stmt = $conn->prepare("SELECT * FROM table1 WHERE (column1 LIKE :txtKeyword OR column2 LIKE :txtKeyword) ORDER BY columnid DESC");
$stmt->bindParam(':txtKeyword', $txtKeyword);
$stmt->execute();
while($result = $stmt->fetch(PDO::FETCH_ASSOC))
$stmt = $conn->prepare("
SELECT * FROM table1
WHERE concat(column1, column2) LIKE :txtKeyword
ORDER BY columnid DESC");
$stmt->bindParam(':txtKeyword', $txtKeyword);
$query_contact = $conn->prepare("SELECT * FROM EMCustContact WHERE CustID=':CustID'");
$query_contact->bindParam(':CustID',$CustID);
$query_contact->execute();
ทำไมมันขึ้น error แบบนี้ตลอดเลยครับเวลา bindparam บน sqlsrv SQLSTATE[IMSSP]: Tried to bind parameter number 65536. SQL Server supports a maximum of 2100 parameters.