Jump to content

cannot find the error


Nuker_Viper
 Share

Recommended Posts

ok i designed a multipart recruitment time editor for this site and tested and it worked fine 4 days ago no edits since then and now it is not working. here is the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '3:00pm EST'' at line 1
it comes up in ** elseif($p == "Schedule_TMH") { ** after submitting the data. Here is the primary code:
<?phpif(checkLogin(MEMBER_NAME, MEMBER_PASS) AND checkRank(MEMBER_RANK, $pid)) {include("include/classes/class_global.php");if($p == "") {echo "<table align='center' border='1' cellspacing='0' cellpadding='3' width='600' bordercolor='FFCC33'><tr><td bordercolor='FFCC33' class='titles' align='center'><b>Manage: Ten Minutes of ######</b></td></tr><tr><td bordercolor='FFCC33' style='border-top-width: 0px' class='main'><br><blockquote>This Shows all Trial Members who are in TMH Stage, reguardless if they have passed, failed, not been scheduled, or are awaiting thier TMH. Note that changing thier TMH times, weather by schuduling them or re-scheduling them, will result in a PM to that Trial Member informing on this.<br><br>";$query = "SELECT * FROM {$dbprefix}requestjoin WHERE ip_check != '0' AND elite_check != '0' AND screenname_check != '0' AND next_stage != '0' AND completed_tmh = '0' ORDER BY tmh_time_int ASC";$result = mysql_query($query)	 or die(mysql_error());while($row = mysql_fetch_array($result)){extract($row);foreach($row AS $key => $value) { ${$key} = addslashes(textFilter($value)); }if($tmh_time_int == 0) { $tmh_time_info = "<font color='green'> - TMH not Scheduled</font>"; $Console_Manage_tmh = "<a href='console.php?pid=$pid&p=Schedule_TMH&join_id=$id&name=$name'>| Schedule TMH |</a>"; }elseif($tmh_time_int == 1) { $tmh_time_info = "<font color='green'> - TMH at $tmh_time</font>"; $Console_Manage_tmh = "<a href='console.php?pid=$pid&p=Passed_TMH&join_id=$id'>| Passed TMH |</a><a href='console.php?pid=$pid&p=Schedule_TMH&join_id=$id&name=$name'>| Re-Schedule TMH |</a><a href='console.php?pid=$pid&p=Failed_TMH&join_id=$id'>| Failed TMH |</a>"; } echo "<tr><td class='main' align='center' width='600'><br><b>$name</b>$tmh_time_info<br><br>$Console_Manage_tmh<br><br></td</tr>";}echo "</blockquote></td></tr></table>";} /// THIS IS WHERE THE ERROR COMES UP ///elseif($p == "Schedule_TMH") {if($submit) {if($tmh_time1 != "USED") {$recruits_id = getMemberInfo("id", $name);$rec_timezone = getMemberInfo("timezone", $name);$new_time = getConvertedTime("converted", $rec_timezone, $tmh_time1);$message1 = "Your TMH time has been changed to $new_time on $this_saturday. Disreguard all other messages reguarding your TMH time. Please be online ready to go 10 minutes prior to this time. Also it is best that you update your profile and re-read the rules of the clan.";$query = "INSERT INTO {$dbprefix}privatemessages (sender_id, receiver_id, datesent, subject, message, status, originalpm_id) VALUES ('$memid', '$recruits_id', '$time', 'Your TMH Time', '$message1', '1', '$original')";$result = mysql_query($query)or die(mysql_error());$query = "UPDATE {$dbprefix}requestjoin SET tmh_time_int = '1', tmh_time = '$tmh_time1' WHERE id = '$join_id'";$result = mysql_query($query)or die(mysql_error());echo "<table width='400' border='0' align='center'><tr><td class='main' width='400' border='3' bordercolor='#FFCC33'>$tmh_success</td></tr></table>"; }else {echo "<table width='400' border='0' align='center'><tr><td class='main' width='400' border='3' bordercolor='#FFCC33'>$tmh_sorry</td></tr></table>";}}elseif(!$submit) {if($mem_timezone_id == 3) {$time_options = "<option value='$pm3'>10:00am - $pm3USED</option><option value='$pm35'>10:30am - $pm35USED</option><option value='$pm4'>11:00am - $pm4USED</option><option value='$pm45'>11:30am - $pm45USED</option><option value='$pm5'>12:00pm - $pm5USED</option><option value='$pm55'>12:30pm - $pm55USED</option><option value='$pm6'>1:00pm - $pm6USED</option><option value='$pm65'>1:30pm - $pm65USED</option><option value='$pm7'>2:00pm - $pm7USED</option><option value='$pm75'>2:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 4) {$time_options = "<option value='$pm3'>11:00am - $pm3USED</option><option value='$pm35'>11:30am - $pm35USED</option><option value='$pm4'>12:00pm - $pm4USED</option><option value='$pm45'>12:30pm - $pm45USED</option><option value='$pm5'>1:00pm - $pm5USED</option><option value='$pm55'>1:30pm - $pm55USED</option><option value='$pm6'>2:00pm - $pm6USED</option><option value='$pm65'>2:30pm - $pm65USED</option><option value='$pm7'>3:00pm - $pm7USED</option><option value='$pm75'>3:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 5) {$time_options = "<option value='$pm3'>12:00pm - $pm3USED</option><option value='$pm35'>12:30pm - $pm35USED</option><option value='$pm4'>1:00pm - $pm4USED</option><option value='$pm45'>1:30pm - $pm45USED</option><option value='$pm5'>2:00pm - $pm5USED</option><option value='$pm55'>2:30pm - $pm55USED</option><option value='$pm6'>3:00pm - $pm6USED</option><option value='$pm65'>3:30pm - $pm65USED</option><option value='$pm7'>4:00pm - $pm7USED</option><option value='$pm75'>4:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 6) {$time_options = "<option value='$pm3'>1:00pm - $pm3USED</option><option value='$pm35'>1:30pm - $pm35USED</option><option value='$pm4'>2:00pm - $pm4USED</option><option value='$pm45'>2:30pm - $pm45USED</option><option value='$pm5'>3:00pm - $pm5USED</option><option value='$pm55'>3:30pm - $pm55USED</option><option value='$pm6'>4:00pm - $pm6USED</option><option value='$pm65'>4:30pm - $pm65USED</option><option value='$pm7'>5:00pm - $pm7USED</option><option value='$pm75'>5:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 7) {$time_options = "<option value='$pm3'>2:00pm - $pm3USED</option><option value='$pm35'>2:30pm - $pm35USED</option><option value='$pm4'>3:00pm - $pm4USED</option><option value='$pm45'>3:30pm - $pm45USED</option><option value='$pm5'>4:00pm - $pm5USED</option><option value='$pm55'>4:30pm - $pm55USED</option><option value='$pm6'>5:00pm - $pm6USED</option><option value='$pm65'>5:30pm - $pm65USED</option><option value='$pm7'>6:00pm - $pm7USED</option><option value='$pm75'>6:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 8) {$time_options = "<option value='$pm3'>3:00pm - $pm3USED</option><option value='$pm35'>3:30pm - $pm35USED</option><option value='$pm4'>4:00pm - $pm4USED</option><option value='$pm45'>4:30pm - $pm45USED</option><option value='$pm5'>5:00pm - $pm5USED</option><option value='$pm55'>5:30pm - $pm55USED</option><option value='$pm6'>6:00pm - $pm6USED</option><option value='$pm65'>6:30pm - $pm65USED</option><option value='$pm7'>7:00pm - $pm7USED</option><option value='$pm75'>7:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 9) {$time_options = "<option value='$pm3'>4:00pm - $pm3USED</option><option value='$pm35'>4:30pm - $pm35USED</option><option value='$pm4'>5:00pm - $pm4USED</option><option value='$pm45'>5:30pm - $pm45USED</option><option value='$pm5'>6:00pm - $pm5USED</option><option value='$pm55'>6:30pm - $pm55USED</option><option value='$pm6'>7:00pm - $pm6USED</option><option value='$pm65'>7:30pm - $pm65USED</option><option value='$pm7'>8:00pm - $pm7USED</option><option value='$pm75'>8:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 10) {$time_options = "<option value='$pm3'>4:30pm - $pm3USED</option><option value='$pm35'>5:00pm - $pm35USED</option><option value='$pm4'>5:30pm - $pm4USED</option><option value='$pm45'>6:00pm - $pm45USED</option><option value='$pm5'>6:30pm - $pm5USED</option><option value='$pm55'>7:00pm - $pm55USED</option><option value='$pm6'>7:30pm - $pm6USED</option><option value='$pm65'>8:00pm - $pm65USED</option><option value='$pm7'>8:30pm - $pm7USED</option><option value='$pm75'>9:00pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 11) {$time_options = "<option value='$pm3'>5:00pm - $pm3USED</option><option value='$pm35'>5:30pm - $pm35USED</option><option value='$pm4'>6:00pm - $pm4USED</option><option value='$pm45'>6:30pm - $pm45USED</option><option value='$pm5'>7:00pm - $pm5USED</option><option value='$pm55'>7:30pm - $pm55USED</option><option value='$pm6'>8:00pm - $pm6USED</option><option value='$pm65'>8:30pm - $pm65USED</option><option value='$pm7'>9:00pm - $pm7USED</option><option value='$pm75'>9:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 12) {$time_options = "<option value='$pm3'>6:00pm - $pm3USED</option><option value='$pm35'>6:30pm - $pm35USED</option><option value='$pm4'>7:00pm - $pm4USED</option><option value='$pm45'>7:30pm - $pm45USED</option><option value='$pm5'>8:00pm - $pm5USED</option><option value='$pm55'>8:30pm - $pm55USED</option><option value='$pm6'>9:00pm - $pm6USED</option><option value='$pm65'>9:30pm - $pm65USED</option><option value='$pm7'>10:00pm - $pm7USED</option><option value='$pm75'>10:30pm - $pm75USED</option>";$contact = "";}elseif($mem_timezone_id == 13) {$time_options = "<option value='$pm3'>7:00pm - $pm3USED</option><option value='$pm35'>7:30pm - $pm35USED</option><option value='$pm4'>8:00pm - $pm4USED</option><option value='$pm45'>8:30pm - $pm45USED</option><option value='$pm5'>9:00pm - $pm5USED</option><option value='$pm55'>9:30pm - $pm55USED</option><option value='$pm6'>10:00pm - $pm6USED</option><option value='$pm65'>10:30pm - $pm65USED</option><option value='$pm7'>11:00pm - $pm7USED</option><option value='$pm75'>11:30pm - $pm75USED</option>";$contact = "";}else {$time_options = "An ERROR Occured";$contact = "<br>Contact:<br>$OpsComm_tmh<br>";}echo "<form action='console.php?pid=$pid&p=Schedule_TMH&join_id=$join_id&name=$name' method='post'><table width='600' border='1' bordercolor='#000000' align='center'><tr><td class='main' width='600' border='1' bordercolor='#FFCC33' align='center'><select name='tmh_time1' class='form'>$time_options</select>$contact</td></tr><tr><td class='titles' align='center' width='600' border='2' bordercolor='#FFCC33'><br><br><input type='submit' name='submit' value='Submit Time' class='apps_formbutton'></td></tr></table></form>"; }}elseif($p == "Passed_TMH") {$query = "UPDATE {$dbprefix}requestjoin SET tmh_time_int = '2' WHERE id = '$join_id'";$result = mysql_query($query)or die(mysql_error());echo "<table width='400' border='0' align='center'><tr><td class='main' width='400' border='3' bordercolor='#FFCC33'>$tmh_success2</td></tr></table>"; }elseif($p == "Failed_TMH") {$query = "UPDATE {$dbprefix}requestjoin SET tmh_time_int = '3' WHERE id = '$join_id'";$result = mysql_query($query)or die(mysql_error());echo "<table width='400' border='0' align='center'><tr><td class='main' width='400' border='3' bordercolor='#FFCC33'>$tmh_success3</td></tr></table>"; }}else {echo "<table align='center' border='0' cellspacing='0' cellpadding='0' width='550'><tr><td class='main' align='center'><img src='images/restrictedarea.png' border='0'></td></tr></table>";} ?>

here is the global.php file:

<?phpinclude("include/classes/class_member.php");include("include/classes/class_tmh.php");include("include/classes/class_recruitment.php");include("include/classes/class_staff.php");$tmh_message = "Choose a time to do your Evaluation.<br><br>These times are auto made to ($mem_timezone) timezone. If this timezone is wrong then go to \"Edit Profile\" in \"Your Account\" and select the correct timezone.<br><br><b>* NOTE *</b><br>If a time frame says \"Used\" then you cannot choose that time as we have someone else there; if you cannot do any of these times then contact:<br>$OpsComm_tmh<br>";$tmh_sorry = "Sorry you Picked a Used time.<br><br>Questions? - Comments? - Problems?<br><b>Contact:</b><br>$OpsComm_tmh<br><br>"; $tmh_success = "Update Complete: Time Selected..<br><br>Questions? - Comments? - Problems?<br><b>Contact:</b><br>$OpsComm_tmh<br><br>";$tmh_success2 = "Update Complete: Recruit has Passed Ten Minutes of ######..<br><br><a href='console.php'>| Your Account |</a><a href='console.php?pid=$pid'>| Manage: TMH Home |</a><br><br>";$tmh_success3 = "Update Complete: Recruit has Failed Ten Minutes of ######..<br><br><a href='console.php'>| Your Account |</a><a href='console.php?pid=$pid'>| Manage: TMH Home |</a><br><br>";$this_saturday = date('l jS F (Y-m-d)', strtotime('this Saturday'));?>

here is the class_tmh.php:

<?php$time_3 = countTMHtimes("3:00pm EST");$time_35 = countTMHtimes("3:30pm EST");$time_4 = countTMHtimes("4:00pm EST");$time_45 = countTMHtimes("4:30pm EST");$time_5 = countTMHtimes("5:00pm EST");$time_55 = countTMHtimes("5:30pm EST");$time_6 = countTMHtimes("6:00pm EST");$time_65 = countTMHtimes("6:30pm EST");$time_7 = countTMHtimes("7:00pm EST");$time_75 = countTMHtimes("7:30pm EST"); if($time_3 != 1) { $pm3 = "3:00pm EST"; $pm3USED = "Open"; } else { $pm3 = "USED"; $pm3USED = "Used"; }if($time_35 != 1) { $pm35 = "3:30pm EST"; $pm35USED = "Open"; } else { $pm35 = "USED"; $pm35USED = "Used"; }if($time_4 != 1) { $pm4 = "4:00pm EST"; $pm4USED = "Open"; } else { $pm4 = "USED"; $pm4USED = "Used"; }if($time_45 != 1) { $pm45 = "4:30pm EST"; $pm45USED = "Open"; } else { $pm45 = "USED"; $pm45USED = "Used"; }if($time_5 != 1) { $pm5 = "5:00pm EST"; $pm5USED = "Open"; } else { $pm5 = "USED"; $pm5USED = "Used"; }if($time_55 != 1) { $pm55 = "5:30pm EST"; $pm55USED = "Open"; } else { $pm55 = "USED"; $pm55USED = "Used"; }if($time_6 != 1) { $pm6 = "6:00pm EST"; $pm6USED = "Open"; } else { $pm6 = "USED"; $pm6USED = "Used"; }if($time_65 != 1) { $pm65 = "6:30pm EST"; $pm65USED = "Open"; } else { $pm65 = "USED"; $pm65USED = "Used"; }if($time_7 != 1) { $pm7 = "7:00pm EST"; $pm7USED = "Open"; } else { $pm7 = "USED"; $pm7USED = "Used"; }if($time_75 != 1) { $pm75 = "7:30pm EST"; $pm75USED = "Open"; } else { $pm75 = "USED"; $pm75USED = "Used"; }?>

and lastly here is the function from the functions page:

function getConvertedTime($needed, $timezone, $s_time) {global $dbprefix;$query = "SELECT * FROM {$dbprefix}timezone_convert WHERE tz = '$timezone' AND convert = '$s_time'";$result = mysql_query($query)	 or die(mysql_error());$row = mysql_fetch_array($result);@extract($row); return $$needed;}

Edited by Nuker_Viper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...