I use this to pull information from DB and display on web page. I would like to modify it to only display information if the field in the DB has been populated. Right now this is what is display
Bob Smith
Buggy
Buggy Sportsman YES
Arena Truck YES
Monster Truck
Stadium Truck
The name is a text field from form and the others are check boxes. Buggy Was not checked so no value, Buggy Sportsman was check so its value was YES and so on.
Heres the mod I need If not checked then it doesnt show anything If check it shows.
Bob Smith
Buggy Sportsman YES
Arena Truck YES
PHP Code:mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_query($query);
$query= 'SELECT Name, Eighth_Scale_Buggy, Eighth_Scale_Sportsman, Arena_Truck, Monster_Truck, Stadium_Truck FROM Entry_Form ORDER BY id DESC LIMIT 0, 250';
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "<i><strong>NO On-Line Forms Filled Out</strong></i><br>";
}else{
echo "<i><strong>Filled out Entry Form</strong></i><br>";
}
mysql_close();
$i=0;
while ($i < $num) {
$Name=mysql_result($result,$i,"Name");
$Eighth_Scale_Buggy=mysql_result($result,$i,"Eighth_Scale_Buggy");
$Eighth_Scale_Sportsman=mysql_result($result,$i,"Eighth_Scale_Sportsman");
$Arena_Truck=mysql_result($result,$i,"Arena_Truck");
$Monster_Truck=mysql_result($result,$i,"Monster_Truck");
$Stadium_Truck=mysql_result($result,$i,"Stadium_Truck");
echo "<b>$Name<br>Buggy $Eighth_Scale_Buggy<br>Buggy Sportsman $Eighth_Scale_Sportsman<br>Arena Truck $Arena_Truck<br>Monster Truck $Monster_Truck<br>Stadium Truck $Stadium_Truck<hr>";
$i++;
}
?>



Reply With Quote
Bookmarks