Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have written the below query in a function:
$dsearch=mysql_real_escape_string($condition['title']);
"select id, title , category, little, strip_tags('description') AS strip_desc,flag ,
POSITION('$dsearch' IN title) AS pos_title,
POSITION('$dsearch' IN strip_desc) AS pos_desc,
from tbl_contents
where title RLIKE '[[:<:]]".$dsearch."[[:>:]]'
description RLIKE '[[:<:]]".$dsearch."[[:>:]]'
order by priority desc"
But the "strip_tags" does not work and I get errors. Is the method for this query wrong?
thanks for your help in advance.
–
–
MySQL does not provide a function called strip_tags
.
Assuming you use access your database using PHP
, you can use the PHP function strip_tags
on each row you fetched:
$strip_desc = strip_tags($row['description']);
See here:
What is the MySQL query equivalent of PHP strip_tags?
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.