Sunday 15 February 2015

php - SELECT * FROM Table WHERE Column LIKE %?% -


Based on the information here ?

Trying to create a PDO query with the experiment

SELECT * from the table where like%?% / P>

SELECT * from table where column?%

SELECT * from the table where the column is like?

Nothing works; get the error

Syntax error or access violation: 1064 You have an error in your SQL syntax; To use the closest '% ...

SELECT * as the table WHERE column, use for the correct syntax of your MySQL server version Check the related manual. But this is not in

for select

what's in the column in the column?

What is the correct pdo in statement for a static placeholder (? )?

Try this by adding values ​​to the string through PHP,

 < Code> $ value = "valueHere"; $ PassThis = "%" $ value "%"; // Other PDO code ... $ stmt = $ dbh- & gt; Ready ("Select from table to table where like column?"); $ Stmt- & gt; Baidumparam (1, $ passThis); // Other PDO code ...    

No comments:

Post a Comment