I have written several MySQL statements using PHP, made the connection and retrieved data. But this is the first itme I am using the LIKE operator.
I can use PHPMyAdmin and write the statment and get data (59 rows)
SELECT *FROM tblSA_articlesWHERE article LIKE '%Photo%'
I take that statement and use it in my PHP page and get (0 rows).
($sql = "SELECT * FROM tblSA_articles WHERE 'article' LIKE '%Photo%' "😉
When writing the statement in PHP it does not like quotes around the table name but PHPMyAdmin does. The statement in the PHP needs the single quotes around the column name and the variable.
Eventually the "%Photo%" will be replaced by an input variable.
Any thoughts?
Thanks