hi all im new here and im new to php
i have a problem with showing the image from my mysql database
here is my table im working with from my database
here is the code to show the imageCode:CREATE TABLE upload2 ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(30) NOT NULL, type VARCHAR(30) NOT NULL, size INT NOT NULL, path VARCHAR(60) NOT NULL, PRIMARY KEY(id) );
HTML Code:<html> <head> <title>Download File From MySQL</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body>so whats wrong about it ?Code:
<?php
$connection = mysql_connect("localhost","root","") or die("impossible de se connecter au serveur mysql.<p>Veuillez réessayer plus tard");
$res = mysql_select_db("upload3") or die("impossible de sélectionner la base de données <b>ecole</b>.<p>Veuillez réessayer plus tard");
$requeteStr = "SELECT path FROM upload2 where id = 4";
$resultatRequete = mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
$result=mysql_query($requeteStr);
while ($row = mysql_fetch_array($result))
{
$path = $row['path'];
echo $path;
?>
<img src="<?$path;?>" border="0">
<?php
}
?>
it showing me an icone instead of the image... its
sad that because i have just one post, i cant show any screenshot of what its look like atm...
but does anyone has a clue why it shows an icone instead of the image ?
Last edited by Jaan; 11-16-2008 at 03:50 AM. Reason: Please use code tags when you're posting your codes!
moved to the correct forum.
I am not entirely sure what you mean. Perhaps upload the screen shot to imageshack or photobucket and post the link, but you have to be clever as to how you post the link, since you don't have enough posts to do that either.
Have you ensured $path is the path to the image, and it does exist?
222
333
444
aaa
www
123
lol
lmao
finally 10 tops
sry to have done 10 posts in a row but i need it to show you the images...
here how its look atm
its not the image thats showing up but an icone... why ?
ImageShack - Hosting :: testja6.jpg
and yes all the path exists in my c:\lol\ here is there screenshot
ImageShack - Hosting :: testdc9.jpg
ImageShack - Hosting :: testqt5.jpg
any idea why my image aint showing up ?
Last edited by WingedPanther; 11-14-2008 at 07:30 PM. Reason: That wasn't absolutely necessary. Just give us the site but NOT as a link, as John alluded to.
This is a funny mistake. You didn't echo/print the path.
orCode:<img src="<?=$path?>" border="0">
Code:<img src="<?echo $path;?>" border="0">
Realize the Web Web services and design.
Another thing i wonder about is why you does the query twice as in above?Code:$requeteStr = "SELECT path FROM upload2 where id = 4";
$resultatRequete = mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
$result=mysql_query($requeteStr);
There was a couple things I was going to point out about his MySQL techniques but I figured I'd just help him with this problem and not bug on how he fetches from MySQL.
Realize the Web Web services and design.
Not to sure, but from the posts above should help you. Mainly the echo command LOL!!
jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!
you guys are maybe pro at php but you guys are moron about the life and how you laugh at someone who needed help im sure u guys werent so good at start in php too
anyway **** off and bye
and the image doesnt show up even with echo
i just see the icone again
you pros...
so ty for the big help...
chow lollllllllllllll
and you can ban me i dont care lollllll
Then don't ask for help. You brought it on your self.
Realize the Web Web services and design.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks