kemper Posted September 8, 2007 Share Posted September 8, 2007 my script: <?php if (iMEMBER) { if (isset($_POST['edit_report'])) { $f07div = stripinput($_POST['f07div']); $game_id = stripinput($_POST['game_id']); $game_date = stripinput($_POST['game_date']); $game_time = stripinput($_POST['game_time']); $home_team = stripinput($_POST['home_team']); $h_score = stripinput($_POST['h_score']); $visit_team = stripinput($_POST['visit_team']); $v_score = stripinput($_POST['v_score']); $field = stripinput($_POST['field']); $referee = stripinput($_POST['referee']); $name = stripinput($_POST['name']); $team = stripinput($_POST['team']); $position = stripinput($_POST['position']); $telephone = stripinput($_POST['telephone']); $email = stripinput($_POST['email']); $comments = stripinput($_POST['comments']); $result = dbquery("UPDATE f2007_gamereports SET gr_user='".$userdata['user_id']."', f07div='$f07div', game_id='$game_id', game_date='$game_date', game_time='$game_time', home_team='$home_team', h_score='$h_score', visit_team='$visit_team', v_score='$v_score', field='$field' referee='$referee' name='$name', team='$team', position='$position', telephone='$telephone', email='$email', comments='$comments', WHERE report_id='$report_id' "); //$result = dbquery("UPDATE ".$db_prefix."faq_cats SET faq_cat_name='$faq_cat_name' WHERE faq_cat_id='$faq_cat_id'"); } if ($step == "edit"){ //$data = dbarray(dbquery( // "SELECT ter.*, user_id,user_name FROM f2007_scheduling ter // LEFT JOIN ".$db_prefix."users tusr ON ter.gr_user=tusr.user_id // WHERE game_id='$game_id'" // )); } $data = dbarray(dbquery("SELECT * FROM f2007_scheduling WHERE game_id='$game_id'")); // note change here $display_time = date("g:i a", strtotime($data['time'])); opentable ($locale['report001']); echo "<form name='reportform' method='post' action='".FUSION_SELF."?game_id=$game_id'> ".$locale['report120']." <div align='center'> <table cellspacing='0' cellpadding='5' class='tbl' width='100%'> <tr> <td valign='top' width='264' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Age & Division:</b></td> <td valign='top' width='433' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['f07div']."</font></p> </td> <td valign='top' width='503' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Status:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#ff0000'> <span style='background-color: #FFFF00'>".$data['status']."</span></font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Game ID:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['game_id']."</font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Game Date:</b></td> <td width=433 valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['game_date']=date("D, M j, Y",strtotime($data['date']))."</font></td> <td width=503 valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td valign='top' width='264' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Game Time</b></td> <td valign='top' width='433' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['game_time']=date("g:i a",strtotime($data['game_time']))."</font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style:solid; border-bottom-width:1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Home Team:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['home_team']."</font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> <b>Score:</b> <input type='text' name='h_score' value='".$data['h_score']."' class='textbox' size='5'></td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Visiting Team:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['visit_team']."</font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> <b>Score:</b> <input type='text' name='v_score' value='".$data['v_score']."' class='textbox' size='5'></td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Field:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'><font color='#FF0000'>".$data['field']." ".$data['field_no']."</font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <p style='margin-top: 0; margin-bottom: 0'><b>Referee:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <p style='margin-top: 0; margin-bottom: 0'> <input type='text' name='referee' value='".$data['referee']."' class='textbox' size='27'></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' bgcolor='#C0C0C0' style='border-style:solid; border-width:1px; ' nowrap height='38'> <b>Name of Person completing this form:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px' height='38'> <input type='text' name='name' value='".$data['name']."' class='textbox' size='27'></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px' height='38'> </td> </tr> <tr> <td width='264' valign='top' bgcolor='#C0C0C0' style='border-style:solid; border-width:1px; ' nowrap> <b>Team Affiliation:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <font color='#FF0000'><select name='team'><option value='select'>select<option value='".$data['home_team']."'>".$data['home_team']."<option value='".$data['visit_team']."'>".$data['visit_team']."</select></font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' bgcolor='#C0C0C0' style='border-style:solid; border-width:1px; ' nowrap> <b>Position:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <font color='#FF0000'><select name='position'><option value='select'>select<option value='Coach'>Coach<option value='Manager'>Manager</select></font></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' bgcolor='#C0C0C0' style='border-style:solid; border-width:1px; ' nowrap> <b>Telephone:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <input type='text' name='telephone' value='".$data['telephone']."' class='textbox' size='27'></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' bgcolor='#C0C0C0' style='border-style:solid; border-width:1px; ' nowrap> <b>email:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:solid; border-left-width:1px'> <input type='text' name='email' value='".$data['email']."' class='textbox' size='27'></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td width='264' valign='top' style='border-style:solid; border-width:1px; ' bgcolor='#C0C0C0' nowrap> <b>Comments:</b></td> <td width='433' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style:solid; border-bottom-width:1px; border-left-style:solid; border-left-width:1px'> <input type='text' name='comments' value='".$data['comments']."' class='textbox' size='45'></td> <td width='503' valign='top' style='border-top-style: solid; border-top-width: 1px; border-bottom-style:solid; border-bottom-width:1px; border-right-style:solid; border-right-width:1px'> </td> </tr> <tr> <td align='center' colspan='3'> <input type='submit' name='edit_report' value='".$locale['report135']."' class='button'></td> </tr> </table> </div> </form>\n"; closetable (); } ?> I am getting: 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 'referee='' name='', team='select', position='select', telephone='', email='', co' at line 1 What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/68445-game-reporting-issue/ Share on other sites More sharing options...
marcus Posted September 8, 2007 Share Posted September 8, 2007 The values are blank. And you don't need that comma before calling the WHERE operator. print_r($_POST) Quote Link to comment https://forums.phpfreaks.com/topic/68445-game-reporting-issue/#findComment-344116 Share on other sites More sharing options...
kemper Posted September 8, 2007 Author Share Posted September 8, 2007 I remove the comma, but am unclear about your other comment. Error message has not changed. Quote Link to comment https://forums.phpfreaks.com/topic/68445-game-reporting-issue/#findComment-344118 Share on other sites More sharing options...
marcus Posted September 8, 2007 Share Posted September 8, 2007 The values obviously don't exist, there would be content within the single quotes if the variables had a string value. Quote Link to comment https://forums.phpfreaks.com/topic/68445-game-reporting-issue/#findComment-344119 Share on other sites More sharing options...
kemper Posted September 8, 2007 Author Share Posted September 8, 2007 Those are set to be fill in, all other fields are pulled from f2007_scheduling table. All fields listed as SQL syntax error are to be completed by user, so I guess I will forge through with no idea what I have done wrong. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/68445-game-reporting-issue/#findComment-344120 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.