Re: echo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You might be missing a quote so here and there unless you have the
quotes stored in the database too.

Since your photos are stored on disk, make sure  the webserver has
access to them.

Then make sure that your string is something like
 <img src="<path><photoFileName>">

in php:  printf("<img src=\"%s%s\">", $somepath, $somefilename);

in your php line: echo "<img src=".$row['photoFileName']." alt='photo'>";

the line echoed doesn't have any quotes in it.

Ron



elk dolk wrote:
> Hi all,
> I am new to web programming. 
>   
> I have code to add pictures to a MYSQL database. Now I can't seem to figure out how to get them back out ! so we can see them. 
>   The MySQL doesn't seem to be a problem (yet), also I'm trying to learn PHP. 
>   
>  What I usually do is to load the images in a folder "img" and then the name of the pic (i.e. "myphoto.jpg") in the database, so i retrieve the name of the pic with: 
>   
>      Code:     <?php 
>  $connex = MySQL_connect(server,login,password); 
>  $sql_query = "select picname from photos where..."; 
>  $result = MySQL_query($sql_query,$connex); 
>  $row = MySQL_fetch_array($result); 
>  ?> 
>    
>  and then: 
>      
>      Code:     echo "<img src=".$row['photoFileName']." alt='photo'>"; 
>    
>   but I can't see the photo
> Any pointers or code samples will be greatly appreciated...
> 
>  
> ---------------------------------
> Bored stiff? Loosen up...
> Download and play hundreds of games for free on Yahoo! Games.

-- 
=================================================================
 It's is not, it isn't ain't, and it's it's, not its, if you mean
 it is. If you don't, it's its. Then too, it's hers. It isn't
 her's. It isn't our's either. It's ours, and likewise yours and
 theirs.
                                              -- Oxford Uni Press
=================================================================
 Ron Croonenberg                   |
                                   | Phone: 1 765 658 4761
 Lab Instructor &                  | Fax:   1 765 658 4732
         Technology Coordinator    |
                                   |
 Department of Computer Science    | e-mail: ronc@xxxxxxxxxx
 DePauw University                 |
 275 Julian Science & Math Center  |
 602 South College Ave.            |
 Greencastle, IN  46135            |
=================================================================
 http://www.csc.depauw.edu/RonCroonenberg.html
=================================================================

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux