I have a little problem and I know it is simple but can;t think. My script is as followed:
<?php
$db = mysql_connect("host_name", "user", "password"
;
mysql_select_db("databse_name", $db);
$result = mysql_query("SELECT * FROM images ORDER BY id DESC LIMIT 1"
;
while($row = mysql_fetch_assoc($result)){
echo $row['image'];
}
?>
My issue is that when I display my page it displays all of the records in the image fileds even the records that do not have an image name in them. the images show up that have an image name in them and the records that do not contain an image name display an image boxe with a broken links.
How do I write a code that saids to display only the records that have an image name in the image field and not display the records that do not have anything in that field.
All help will be appreciated in advance.
Max
Nothing is hard when you realy want to learn it.
Max
<?php
$db = mysql_connect("host_name", "user", "password"
mysql_select_db("databse_name", $db);
$result = mysql_query("SELECT * FROM images ORDER BY id DESC LIMIT 1"
while($row = mysql_fetch_assoc($result)){
echo $row['image'];
}
?>
My issue is that when I display my page it displays all of the records in the image fileds even the records that do not have an image name in them. the images show up that have an image name in them and the records that do not contain an image name display an image boxe with a broken links.
How do I write a code that saids to display only the records that have an image name in the image field and not display the records that do not have anything in that field.
All help will be appreciated in advance.
Max
Nothing is hard when you realy want to learn it.
Max