Xtremer360 Posted May 19, 2010 Share Posted May 19, 2010 I don't know what the problem is here. Its not sending to the database and I echoed the query and it's not showing the query so I'm confused. <?php $e = <<<here <script type="text/javascript" src="./jscripts/ajax.js"></script> <script type="text/javascript" src="./jscripts/ts_picker.js"></script> here; switch ($_REQUEST['option']) { case 0: echo $e; ?> <h1 class=backstage>Show Booking Management</h1><br /> <form name="eventbooker" method="post"> <input type="hidden" name="action" value="eventbooker" /> <table width="100%" class="table2"> <tr> <td width="150" valign="center" class="rowheading">Show Name:</td> <td class="row3"> <select name="event" class="dropdown"> <option value="Null">- Select -</option> <?php $query = "SELECT * FROM efed_list_shownames"; $result = mysql_query ( $query ); while ( $row = mysql_fetch_assoc ( $result ) ) { print "<option value=\"".$row['id']."\">".$row['name']."</option>\r"; } ?> </select></td> <td class="row3" width="180"><span class="reduced">Set up in show Name Manager</span></td> </tr> <tr> <td width="150" valign="center" class="rowheading">Air Date</td> <td class="row3"><input type="text" name="bookingdate" class="fieldtext80" value=""><a href="javascript:show_calendar(document.eventbooker.bookingdate, document.eventbooker.bookingdate.value);"><img src="http://www.defiantwrestling.net/backstage/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick the date"></a></td> <td class="row3"><span class="reduced">dd-mm-yyyy</span></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">No. of Matches:</td> <td class="row3"><input type="text" name="numberofmatches" class="fieldtext40"></td> <td class="row3"><span class="reduced">More can be added later</span></td> </tr> <tr> <td class="rowheading">Country</td> <td class="row3" colspan="2"> <select name="countryid" class="dropdown" onchange="ajaxpage('backstageajax.php?random=625094862&routine=arenas&countryid='+this.value,'arenaajax');"> <option value=0>- Select -</option> <?php $query = 'SELECT * FROM efed_list_arenas_countries'; $result = mysql_query ( $query ); while ( $row = mysql_fetch_assoc ( $result ) ) { print "<option value=\"".$row['id']."\">".$row['country']."</option>\r"; } ?> </select></td> </tr> <tr> <td class="rowheading">Arena</td> <td class="row3" colspan="2"><div id="arenaajax"> <select name="arenaid" class="dropdown"> <option value="0">- Select Arena -</select> </div></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">Bell Time:</td> <td class="row3"><input type="text" name="belltime" class="fieldtext40"></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">Door Time:</td> <td class="row3"><input type="text" name="doortime" class="fieldtext40"></td> </tr> </table><br /> <input type="hidden" name="newadded" value="true"> <input type="submit" value="Add Booking" class="button" name="submit"><br /> <input type="button" value="Return to Booking Manager" class="button200"><br /><br /></form> <?php returnmain(); footercode(); break; } function eventbooker() { if ((!empty($_POST['newadded']))) { $event = mysql_real_escape_string($_POST['event']); $bookingdate = mysql_real_escape_string($_POST['bookingdate']); $numberofmatches = mysql_real_escape_string($_POST['numberofmatches']); $arenaid = mysql_real_escape_string($_POST['arenaid']); $belltime = mysql_real_escape_string($_POST['belltime']); $doortime = mysql_real_escape_string($_POST['doortime']); $query = "INSERT INTO `efed_content_booking` (event_id,label,status_id,bookingdate,location,arena_id,belltime,doorsopen,matches) VALUES ('".$event."', 1,1, '".$bookingdate."', '".$location."','".$arenaid."', '".$belltime."','".$doortime."','".$numberofmatches."')"; mysql_query($query); echo $query; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/202282-not-posting-to-db/ Share on other sites More sharing options...
ale8oneboy Posted May 19, 2010 Share Posted May 19, 2010 I don't know what the problem is here. Its not sending to the database and I echoed the query and it's not showing the query so I'm confused. <?php $e = <<<here <script type="text/javascript" src="./jscripts/ajax.js"></script> <script type="text/javascript" src="./jscripts/ts_picker.js"></script> here; switch ($_REQUEST['option']) { case 0: echo $e; ?> <h1 class=backstage>Show Booking Management</h1><br /> <form name="eventbooker" method="post"> <input type="hidden" name="action" value="eventbooker" /> <table width="100%" class="table2"> <tr> <td width="150" valign="center" class="rowheading">Show Name:</td> <td class="row3"> <select name="event" class="dropdown"> <option value="Null">- Select -</option> <?php $query = "SELECT * FROM efed_list_shownames"; $result = mysql_query ( $query ); while ( $row = mysql_fetch_assoc ( $result ) ) { print "<option value=\"".$row['id']."\">".$row['name']."</option>\r"; } ?> </select></td> <td class="row3" width="180"><span class="reduced">Set up in show Name Manager</span></td> </tr> <tr> <td width="150" valign="center" class="rowheading">Air Date</td> <td class="row3"><input type="text" name="bookingdate" class="fieldtext80" value=""><a href="javascript:show_calendar(document.eventbooker.bookingdate, document.eventbooker.bookingdate.value);"><img src="http://www.defiantwrestling.net/backstage/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick the date"></a></td> <td class="row3"><span class="reduced">dd-mm-yyyy</span></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">No. of Matches:</td> <td class="row3"><input type="text" name="numberofmatches" class="fieldtext40"></td> <td class="row3"><span class="reduced">More can be added later</span></td> </tr> <tr> <td class="rowheading">Country</td> <td class="row3" colspan="2"> <select name="countryid" class="dropdown" onchange="ajaxpage('backstageajax.php?random=625094862&routine=arenas&countryid='+this.value,'arenaajax');"> <option value=0>- Select -</option> <?php $query = 'SELECT * FROM efed_list_arenas_countries'; $result = mysql_query ( $query ); while ( $row = mysql_fetch_assoc ( $result ) ) { print "<option value=\"".$row['id']."\">".$row['country']."</option>\r"; } ?> </select></td> </tr> <tr> <td class="rowheading">Arena</td> <td class="row3" colspan="2"><div id="arenaajax"> <select name="arenaid" class="dropdown"> <option value="0">- Select Arena -</select> </div></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">Bell Time:</td> <td class="row3"><input type="text" name="belltime" class="fieldtext40"></td> </tr> <tr> <td class="rowheading" width="150" valign="center" class="rowheading">Door Time:</td> <td class="row3"><input type="text" name="doortime" class="fieldtext40"></td> </tr> </table><br /> <input type="hidden" name="newadded" value="true"> <input type="submit" value="Add Booking" class="button" name="submit"><br /> <input type="button" value="Return to Booking Manager" class="button200"><br /><br /></form> <?php returnmain(); footercode(); break; } function eventbooker() { if ((!empty($_POST['newadded']))) { $event = mysql_real_escape_string($_POST['event']); $bookingdate = mysql_real_escape_string($_POST['bookingdate']); $numberofmatches = mysql_real_escape_string($_POST['numberofmatches']); $arenaid = mysql_real_escape_string($_POST['arenaid']); $belltime = mysql_real_escape_string($_POST['belltime']); $doortime = mysql_real_escape_string($_POST['doortime']); $query = "INSERT INTO `efed_content_booking` (event_id,label,status_id,bookingdate,location,arena_id,belltime,doorsopen,matches) VALUES ('".$event."', 1,1, '".$bookingdate."', '".$location."','".$arenaid."', '".$belltime."','".$doortime."','".$numberofmatches."')"; mysql_query($query); echo $query; } } ?> Where is the function call for eventbooker()? Quote Link to comment https://forums.phpfreaks.com/topic/202282-not-posting-to-db/#findComment-1060675 Share on other sites More sharing options...
Xtremer360 Posted May 19, 2010 Author Share Posted May 19, 2010 <input type="hidden" name="action" value="eventbooker" /> Quote Link to comment https://forums.phpfreaks.com/topic/202282-not-posting-to-db/#findComment-1060676 Share on other sites More sharing options...
ale8oneboy Posted May 19, 2010 Share Posted May 19, 2010 That would work. But you also need something in php to call the function. Maybe try adding. <?php if($_POST['action'] == 'eventbooker') { eventbooker(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/202282-not-posting-to-db/#findComment-1060697 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.