Return to Snippet

Revision: 54388
at December 22, 2011 01:12 by blantonious

Initial Code
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM db*****") or die(mysql_error());

//Puts it into an array
while($info = mysql_fetch_array( $data ))

        <div class="member">
        <div class="imageSection">

        if($info['photo'] == '')
         {echo "<img class=\"memberImage\" src=images/default.jpg>";}
          else {echo "<img class=\"memberImage\" src=images/".$info['photo'] .">";}

Initial URL

Initial Description
If the image source is not in the database a default image is displayed.

Initial Title
Display default image if not in database

Initial Tags
mysql, php

Initial Language