Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to retrieve image from database to html form?
    primarykey
    data
    text
    <p>I save my image name to my database and image itself to upload file.</p> <p>When the user want to see them, I want to show them to user with in a div.</p> <p>Here things get messy in my mind.</p> <p>here is my php code</p> <pre><code> $con = mysql_connect("localhost","root",""); if (!$con){die('Could not connect: ' . mysql_error());} mysql_select_db("marmaris", $con); $bilgi= mysql_query("SELECT * FROM ".$isim." WHERE id='".$id."'"); while($sutun= mysql_fetch_array($bilgi)) { $name=$sutun["name"]; $bures=$sutun["resbuyuk"]; $kures=$sutun["reskucuk"]; $aciklama=$sutun["aciklama"]; $map=$sutun["map"]; $link=$sutun["link"]; } $words = preg_split('/[\s?]+/', $kures); $result = count($words); for($i=0;$i&lt;$result;$i++){ $city=$words[$i]; } </code></pre> <p>i got 6 images now $city is one of the image forexample i want to show the user that image. </p> <p>this is my html part don't worry about the isimid name its just sending 2 words at one time.</p> <pre><code> &lt;div id="kucukres"&gt; &lt;img src="upload/&lt;?php echo $city ?&gt;" alt="Angry face" width="32" height="32" /&gt; &lt;/div&gt; </code></pre> <p>I want to show the image but it only writes the alt words.</p> <p>In summary, I want to show image that has saved (the name) in database and itself in the upload folder.</p> <p>With php part, I take the name of the file from database; in html, I want to show that image.</p> <p>edit : this is my new html tag.</p> <pre><code> &lt;div id="kucukres"&gt; &lt;img src="getres.php?file=&lt;?php echo $isimid;?&gt;"/&gt; &lt;/div&gt; </code></pre> <p>and my php file is </p> <pre><code>$bilgi= mysql_query("SELECT reskucuk FROM ".$isim." WHERE id='".$id."'"); while($sutun= mysql_fetch_array($bilgi)) { $kures=$sutun["reskucuk"]; } $words = preg_split('/[\s?]+/', $kures); $result = count($words); //unlink("upload/$word[$isim]"); for($i=0;$i&lt;$result;$i++){ $city=$words[$i]; header('Content-type: image/jpeg'); $pic = 'upload/'.$city; echo $pic; </code></pre> <p>but still i cant see the image in my html file.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload