This is an example of the way I get a list of articles to appear on the webpage. I use a small image beside each brief piece of text.
However, sometimes there isn't an image.
How can I say within this code then, if there isn't an image, go straight onto the text, please?
In different coding, I can use
if ($myrow["fieldname"])
but that arrangement doesn't work with this format.
However, sometimes there isn't an image.
How can I say within this code then, if there isn't an image, go straight onto the text, please?
In different coding, I can use
if ($myrow["fieldname"])
but that arrangement doesn't work with this format.
Code:
$result = mysql_query("SELECT id, head, pfolder, px, blurb
etc etc ...")
if ($myrow = mysql_fetch_assoc($result))
{
do
{
printf("<h1>%s </h1>
<img src=\"../images/%s/
%s
3.jpg\" align=\"left\" title=\"
%s.\" alt=\"
%s.\">
%s \n ...
<br><span class=\"aim\"><a href=\"%s?id=%s\" title=\"Link to the article.\">
Article %s »</a>
</span> <br>
<div id=\"date2\"> %s</div><br>
<hr align=\"left\" color=\"#FFFFFF\" width=\"250\" size=\"1\"><br>\n",
$myrow["head"],
$myrow["pfolder"],
$myrow["px"],
$myrow["blurb"] etc etc