php - mysql: not able to retrieve data which is in between symbols -



php - mysql: not able to retrieve data which is in between <> symbols -

am running sql query php retrieve info mysql database. works except that, if info contains symbols < , >, whatever info nowadays between these symbols doesnt show in output.

for example, if info "<hello there> how you?" "how you?" shown.

but when run query directly, shows me without missing anything.

i have done before, cannot remember on top of head did. , google not helping me today, slow day me.... :(

you should escape databse response using htmlentities().

$sql = 'select row_with_text your_table'; $query = mysql_query($sql); $result = mysql_fetch_array($query); echo htmlentities($result['row_with_text']);

phpmyadmin escaping you, it's responsibility escape text html in application.

php mysql

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -