big-dog1965
02-11-2007, 12:38 AM
Hi Newbie here Ive tried several things in the way of php and javascript and none seem to work,
I have a form that the user fills out and submits the information gets stored in mysql. then a php file pulls information from mysql and displays it on a page.
On the form theres a drop down box that is optional "Second Cass" the default value is Select One if the user doesnt select one then select one is stored in mysql which I dont care about that, but when the php file pulls the information and displays it if the information from that drop down is select one I dont want to display it if its any thing else it can display it. ANY IDEAS
Remember Im a newbie heres php code page.
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = 'DELETE FROM Registration WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) >= `Race_Date`';
mysql_query($query);
$query = 'DELETE FROM Registration WHERE Race_Date = \'0000-00-00\'';
mysql_query($query);
$query="SELECT First_Name, First_Class, Second_Class, Race_Date FROM Registration ORDER BY Race_Date DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "<b>NO Drivers Registered Yet</b><br>";
}else{
}
mysql_close();
echo "<b>Registered Drivers</b><br>";
$i=0;
while ($i < $num) {
$First_Name=mysql_result($result,$i,"First_Name");
$First_Class=mysql_result($result,$i,"First_Class");
$Second_Class=mysql_result($result,$i,"Second_Class");
$Race_Date=mysql_result($result,$i,"Race_Date");
echo "<b>$First_Name<br>$Race_Date</b><br>$First_Class<br>$Second_Class<hr>";
$i++;
}
?>
I have a form that the user fills out and submits the information gets stored in mysql. then a php file pulls information from mysql and displays it on a page.
On the form theres a drop down box that is optional "Second Cass" the default value is Select One if the user doesnt select one then select one is stored in mysql which I dont care about that, but when the php file pulls the information and displays it if the information from that drop down is select one I dont want to display it if its any thing else it can display it. ANY IDEAS
Remember Im a newbie heres php code page.
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = 'DELETE FROM Registration WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) >= `Race_Date`';
mysql_query($query);
$query = 'DELETE FROM Registration WHERE Race_Date = \'0000-00-00\'';
mysql_query($query);
$query="SELECT First_Name, First_Class, Second_Class, Race_Date FROM Registration ORDER BY Race_Date DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "<b>NO Drivers Registered Yet</b><br>";
}else{
}
mysql_close();
echo "<b>Registered Drivers</b><br>";
$i=0;
while ($i < $num) {
$First_Name=mysql_result($result,$i,"First_Name");
$First_Class=mysql_result($result,$i,"First_Class");
$Second_Class=mysql_result($result,$i,"Second_Class");
$Race_Date=mysql_result($result,$i,"Race_Date");
echo "<b>$First_Name<br>$Race_Date</b><br>$First_Class<br>$Second_Class<hr>";
$i++;
}
?>