|
Posted by The Eclectic Electric on 08/05/06 13:42
<LawrenceTLamb@gmail.com> wrote in message
news:1154784340.211018.104960@75g2000cwc.googlegroups.com...
> Hi everyone!
>
> Am developing my first dynamic web-site using php and my sql.
>
> Still at the beginning but am going a bit mad as one does after sevral
> hours of searching for answeres on google and can't find exactly what
> you are looking for...
>
> Hope you can help!
>
> I have an index.php page which calls an include to retrieve some basic
> data from a mysql table.
>
> I have had no problem retrieving the text data from the database and
> displaying it. (Page set up with html tables)
>
> I store my images in an /images subdirectory. a.jpg, b.jpg etc.
>
> I have a row in the mysql database table called image_ref where the
> file name is stored.
>
> However, when I try to call the image from the directory via the ref in
> database I get a broken image.
>
> Code I have been trying to use is:
>
> Print "<td rowspan=\"4\"><img
> src=\"images/\"".$info['image_ref']."></td>";
>
> This is giving the following result in the source code:
>
> <img src="images/"cp_sagres.jpg>
>
> i.e. an extra " - so the src cannot be read correctly and the image not
> displayed.
>
> I have spent hours trying to change the escapes etc to no avail. Looked
> in books for examples...none.
>
> All advice (including directions to suitable tutorials) would be
> appreciated and grovelled.
>
>
> Chris
>
src=\"images/\"".$info['image_ref']."></td>";
^
|
Noob myself so I may be talking nonsense, but it seems that you're getting
out what you've put in - you've escaped a " here, whereas I think it needs
to be after the filename, i.e.
Print "<td rowspan=\"4\"><img src=\"images/".$info['image_ref']."\"></td>";
+e
Navigation:
[Reply to this message]
|