this code work only in admin page but can't work in view page how to retrieve image from view page in codelgniter
$result = mysql_query("SELECT * FROM photos");
while($row = mysql_fetch_array($result))
echo '<div id="imagelist">';
echo '<p><img src="'.$row['location'].'"></p>';
echo '<p id="caption">'.$row['caption'].' </p>';
Why you use
mysql extension in codeigniter ?!
Even though the meaning of that code work in admin is you store your image inside admin folder
So for best practice
Please use codeIgniter as a FrameWork not a place to paste your procedural PHP code !
Also show us what is in