<?php
$query= stripslashes("select * from picture where username = '$stuff' order by count desc limit 0,500"); // query string stored in a variable
$rt=mysql_query($query); // query executed
echo mysql_error(); // if any error is there that will be printed to the screen
while($nt=mysql_fetch_array($rt)){
echo "<img width=200 height=200 src=" . $nt[picture] . "> <br> $nt[cap] <br>"; // picture class and mark will be printed with one line break
};
?>
Working with images in php
Page 1 of 11 Replies - 219 Views - Last Post: 09 August 2012 - 10:21 PM
#1
Working with images in php
Posted 09 August 2012 - 09:22 PM
I have been making a photo album on my website that pulls off pictures from a database and puts them on the screen. whats wrong is that every time i put a picture on the database that has a space in its name it ends right htere and hte picture becomes blank. so say the picture is called "turtles 10.jpg" it would just look for a picture called "turtles"
Replies To: Working with images in php
#2
Re: Working with images in php
Posted 09 August 2012 - 10:21 PM
missing quotes for the src attribute.
your img tag would look like: <img width=200 height=200 src=turtles 10.jpg> in HTML where "10.jpg" would fall under the "unknown attribute" category.
a good reason to *always* quote attribute values.
your img tag would look like: <img width=200 height=200 src=turtles 10.jpg> in HTML where "10.jpg" would fall under the "unknown attribute" category.
a good reason to *always* quote attribute values.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|