• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot get image path from the database table

#1
            i have stored image path in the database but i cannot retrieve it using query if i do i'm getting nothing .

here i have attched the images of database table and my coding the output !
please help me

and one more issue ,
i'm having data like <p>sss<img src="path" /></p> this in table but while retrieving I'm getting only the sss , (CANNOT WE RETRIEVE ANY HTML TAGS FROM THE DATABASE ?)
Thanks and Regards,
Thamaraiselvam T
Reply

#2
Hello Thamaraiselvam,

I had the same problem when getting a xml string from database in one of my projects, the problem is that CI is escaping a lot of characters like "<" or ">" and others which appears in markup tags.

The only way to avoid values to be escape is to use the query() method from Database Class instead of Active Record methods.

So your code should look like this :

PHP Code:
$query $this->db->query("SELECT * FROM data");

foreach(
$query->result() as $row)
    
print_r($row); 

It should solve your problem, if not feel free to ask again Smile

Good luck !
Reply

#3
Make sure you don't have xss_filter activated in the config file. Also try saving with htmlspecialchars() http://stackoverflow.com/questions/16506...ot-working
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.