phpocean Posted June 9, 2009 Share Posted June 9, 2009 I have a question but can't search on google since google doesn't do < > search. In my MySQL, I wanted to input < > instead of < and > because < and > only take 2 characters as suppose to 8 with < and > Or is there another way? Link to comment https://forums.phpfreaks.com/topic/161598-getting-and-from-mysql-to-display-on-php-page/ Share on other sites More sharing options...
ldougherty Posted June 9, 2009 Share Posted June 9, 2009 When you say you want to input them, do you mean you want to be able to write values with < and > into a database field? mysql_escape_string http://us2.php.net/mysql_escape_string Link to comment https://forums.phpfreaks.com/topic/161598-getting-and-from-mysql-to-display-on-php-page/#findComment-852707 Share on other sites More sharing options...
PFMaBiSmAd Posted June 9, 2009 Share Posted June 9, 2009 You can input and store them as a single character any time you want. If you want them to be displayed instead of being treated as part of a HTML tag, you must convert them to < and > before you output them to the browser. Link to comment https://forums.phpfreaks.com/topic/161598-getting-and-from-mysql-to-display-on-php-page/#findComment-852709 Share on other sites More sharing options...
phpocean Posted June 9, 2009 Author Share Posted June 9, 2009 When I store them in MySQL as < and >, it won't show my on my php page. Say if I store it like <News> in MySQL, it will show as News without the <> on my php page. By the way, are you saying if I input them through php INSERT code instead of phpMyAdmin, it will show? But isn't there a way to do it using phpMyAdmin? Link to comment https://forums.phpfreaks.com/topic/161598-getting-and-from-mysql-to-display-on-php-page/#findComment-852721 Share on other sites More sharing options...
Ken2k7 Posted June 11, 2009 Share Posted June 11, 2009 It should work if you just INSERT into it. If you view it via phpMyAdmin, do you see the < > in the table? Link to comment https://forums.phpfreaks.com/topic/161598-getting-and-from-mysql-to-display-on-php-page/#findComment-853495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.