hello, I have a very simply page, the users can signup for a certain time to volunteer, when they hit submit, the page reloads but I want their time to be inserted in the db and then displayed. After I hit submit, it brings me back to the page but their info isn't there until I refresh. Sometimes their data never shows up yet I can print off the sql statements, run them against the db and see all the data...is the script just loading to fast? I have only tested this running locally.
Thanks, Eddie <? require("connection.php"); if ($bikers){$SQL = "insert into bbreak(name,time) values ('$name','$time') "; $result = mysql_db_query($db,"$SQL",$connection); } ?> <center> Please sign up for the hours that you can work. We need a minimum of 3 men there for each shift. They will be doing the tire pressure checks and any other minor maintenance that might be required. Ladies are also urged to come as we are hoping there will be women bikers that we can minister to in whatever way is needed. Anyone can come anytime but we need to have enough commitments that we know the break will be staffed adequately every shift. We cannot give away anything that would compete with the drinks and snacks that are sold at the rest stop but we can give away ice water and possibly coffee. Thanks for your help! <br> <br> <br> <br> <center> <FORM name="bikers" action="bikers.php" method=post> Name <input type='text' name='name' maxlength='25'> Time <SELECT name="time"> <OPTION value=288 selected>Friday, February 28, 8 a.m.-12 p.m.</OPTION> <OPTION value=2812>Friday, February 28, 12 p.m.-4 p.m.</OPTION> <OPTION value=284>Friday, February 28, 4 p.m.-8 p.m.</OPTION> <OPTION value=18>Saturday, March 1, 8 a.m.-12 p.m.</OPTION> <OPTION value=112>Saturday, March 1, 12 p.m.-4 p.m.</OPTION> <OPTION value=14>Saturday, March 1, 4 p.m.-8 p.m.</OPTION> <OPTION value=28>Sunday, March 2, 8 a.m.-12 p.m.</OPTION> <OPTION value=212>Sunday, March 2, 12 p.m.-4 p.m.</OPTION> <OPTION value=24>Sunday, March 2, 4 p.m.-8 p.m.</OPTION> </SELECT> <INPUT type=submit value=SignUp name=bikers> <table width='95%'> <tr bgColor=#990000><td> <? $SQL = "select * from bbreak where time=288 "; $result = mysql_db_query($db,"$SQL",$connection); $myrow = mysql_fetch_array($result); ?> <center> <font face='arial' size='3' color='ffffff'>Friday February 28th 8 AM to Noon </td></tr> <? while ($myrow = mysql_fetch_array($result)){ print "<tr><td><center>"; print $myrow["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#999999><td> <? $SQL1 = "select * from bbreak where time=2812 "; $result1 = mysql_db_query($db,"$SQL1",$connection); $myrow1 = mysql_fetch_array($result1); ?> <center> <font face='arial' size='3' color='ffffff'>Friday February 28th 12 p.m to 4 p.m. </td></tr> <? while ($myrow1 = mysql_fetch_array($result1)){ print "<tr><td><center>"; print $myrow1["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#000066><td> <? $SQL2 = "select * from bbreak where time=284"; $result2 = mysql_db_query($db,"$SQL2",$connection); $myrow2 = mysql_fetch_array($result2); ?> <center> <font face='arial' size='3' color='ffffff'>Friday February 28th 4 p.m. to 8 p.m. </td></tr> <? while ($myrow2 = mysql_fetch_array($result2)){ print "<tr><td><center>"; print $myrow2["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#990000><td> <? $SQL3 = "select * from bbreak where time=18"; $result3 = mysql_db_query($db,"$SQL3",$connection); $myrow3 = mysql_fetch_array($result3); ?> <center> <font face='arial' size='3' color='ffffff'>Saturday March 1st 8 AM to Noon </td></tr> <? while ($myrow3 = mysql_fetch_array($result3)){ print "<tr><td><center>"; print $myrow3["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#999999><td> <? $SQL4 = "select * from bbreak where time=112"; $result4 = mysql_db_query($db,"$SQL4",$connection); $myrow4 = mysql_fetch_array($result4); ?> <center> <font face='arial' size='3' color='ffffff'>Saturday March 1st 12 p.m to 4 p.m. </td></tr> <? while ($myrow4 = mysql_fetch_array($result4)){ print "<tr><td><center>"; print $myrow4["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#000066><td> <? $SQL5 = "select * from bbreak where time=14"; $result5 = mysql_db_query($db,"$SQL5",$connection); $myrow5 = mysql_fetch_array($result5); ?> <center> <font face='arial' size='3' color='ffffff'>Saturday March 1st 4 p.m. to 8 p.m. </td></tr> <? while ($myrow5 = mysql_fetch_array($result5)){ print "<tr><td><center>"; print $myrow5["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#990000><td> <? $SQL6 = "select * from bbreak where time=28"; $result6 = mysql_db_query($db,"$SQL6",$connection); $myrow6 = mysql_fetch_array($result6); ?> <center> <font face='arial' size='3' color='ffffff'>Sunday March 2nd 8 AM to Noon </td></tr> <? while ($myrow6 = mysql_fetch_array($result6)){ print "<tr><td><center>"; print $myrow6["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#999999><td> <? $SQL = "select * from bbreak where time=212"; $result = mysql_db_query($db,"$SQL",$connection); $myrow = mysql_fetch_array($result); ?> <center> <font face='arial' size='3' color='ffffff'>Sunday March 2nd 12 p.m to 4 p.m. </td></tr> <? while ($myrow = mysql_fetch_array($result)){ print "<tr><td><center>"; print $myrow["name"]; print "</tr></td>"; } ?> </table> <table width='95%'> <tr bgColor=#000066><td> <? $SQL = "select * from bbreak where time=24 "; $result = mysql_db_query($db,"$SQL",$connection); $myrow = mysql_fetch_array($result); ?> <center> <font face='arial' size='3' color='ffffff'>Sunday March 2nd 4 p.m. to 8 p.m. </td></tr> <? while ($myrow = mysql_fetch_array($result)){ print "<tr><td><center>"; print $myrow["name"]; print "</tr></td>"; } ?> </table> </BODY> </HTML>