Output errors

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

 



Hi there,

I am working to a deadline, and missed something probably simple here.

I have this code, and as I have an if else statement inbetween, it is not outputting the image name from the database, and rather just how I put the code in ie. $image.

Could someone see where I am going wrong. Help much appreciated. Code selection below.

if (mysql_num_rows($sql_result) ==0)
{
echo ("  \n");
}
else {
        while ($row = mysql_fetch_array($sql_result)){
  $title = $row["title"];
  $description = $row["description"];
  $image = $row["image"];

        echo ("<tr> \n");
        echo ("<td width=\"72%\" valign=\"top\"><h3>$title</h3> \n");
        echo ("<p>$description</p></td> \n");
        echo ("<td width=\"28%\" valign=\"top\">  \n");        
            if ($image =='NULL') { echo ''; }
            else { echo '<p><img src=$image width="201" height="160"></p></td>'; }
        echo ("</tr> \n");        
        }}


Thanks

Barry

-- 
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