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
Post a Comment