![]() |
retrive data from database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: retrive data from database (/showthread.php?tid=17627) |
retrive data from database - El Forum - 04-10-2009 [eluser]abada[/eluser] hello i used tinymce editor and my question is how can read (html)data from database to show it this is my insert fn model Code: function addNews() and this my query fn Code: function getNewsData() the data not showen as inserted formatted thanks retrive data from database - El Forum - 04-10-2009 [eluser]bigtony[/eluser] You could try using html_entity_decode when reading from database in order to reverse the action of htmlentities. Something that concerns me about your code is using $_REQUEST. Values in here should not be trusted as malicious users can insert scripts or sql injections (same problem if directly using $_POST or $_GET). I strongly recommend you use the $this->input->post('fieldname') function that comes with codeigniter, and make sure you are also doing xss_clean (you can set it to run automatically). This will make your scripts much safer from hackers. retrive data from database - El Forum - 04-10-2009 [eluser]abada[/eluser] thanks bigtony but i really use bigtony html_entity_decode echo html_entity_decode($data['condesc'][0]['news_desc_en']); any other solution and i have another problem if i use smile in tinymce it doesn`t appear when i read it feom database thanks all retrive data from database - El Forum - 04-11-2009 [eluser]bigtony[/eluser] [quote author="abada" date="1239406244"]thanks bigtony but i really use bigtony html_entity_decode echo html_entity_decode($data['condesc'][0]['news_desc_en']); any other solution and i have another problem if i use smile in tinymce it doesn`t appear when i read it feom database thanks all[/quote] I usually use active record to read & write to database, and when I used it with tinymce I did not need to use either htmlentities or html_entity_decode. Might be worth trying for you. Sorry, never used smilies but maybe active record might solve for this too!? |