lakeshoretech Posted November 6, 2010 Share Posted November 6, 2010 If anyone can help find the issue here.. I would much appreciate it! Also, if you see anything whacked out, please feel free to point that out (esp the CASE WHEN as I'm looking to do a IF THEN in the WHERE to show ALL records if no choice is made by user) ERROR: Parse error: syntax error, unexpected T_LNUMBER in /home/ubas..... port/public_html/modules/mod_php/mod_php.php(36) : eval()'d code on line 59 Upcoming Schedule <form action="" method="post"> <select name="team_id"> <option value="33" selected="selected">default pick</option> <option value="999">team 999</option> <option value="11">team 11</option> <option value="22">team 22</option> </select> <br><br> <input type="Submit"> </form> // FROM HERE <?php $team_id = JRequest::getVar('team_id'); $username=xx; $password="sss"; $database="5555"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT uba_teams.team_coach, uba_teams.team_name, uba_schedule.sch_date, uba_schedule.game_location, uba_schedule.game_time, uba_schedule.opp_name FROM uba_schedule INNER JOIN uba_teams ON uba_schedule.team_id = uba_teams.team_id WHERE (uba_schedule.sch_uba_score IS NULL) AND (CASE $team_id WHEN 999 THEN uba_teams.team_id ELSE uba_teams.team_id = $team_id END) ORDER BY uba_schedule.sch_date ASC $result=mysql_query($query); $num=mysql_numrows($result); ?> <table border="2" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">player_id</font></th> <th><font face="Arial, Helvetica, sans-serif">first</font></th> <th><font face="Arial, Helvetica, sans-serif">last</font></th> <th><font face="Arial, Helvetica, sans-serif">age group</font></th> <th><font face="Arial, Helvetica, sans-serif">game id</font></th> <th><font face="Arial, Helvetica, sans-serif">coach name</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"uba_teams.team_coach"); $f2=mysql_result($result,$i,"uba_teams.team_coach"); $f3=mysql_result($result,$i,"uba_teams.team_coach"); $f4=mysql_result($result,$i,"uba_teams.team_coach"); $f5=mysql_result($result,$i,"uba_teams.team_coach"); $f6=mysql_result($result,$i,"uba_teams.team_coach"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> </tr> <?php $i++; } ?> Link to comment https://forums.phpfreaks.com/topic/217967-unexpected-t_lnumber-help-with-syntax-sql/ Share on other sites More sharing options...
Yucky Posted November 6, 2010 Share Posted November 6, 2010 You've left "; off the end of your query. Link to comment https://forums.phpfreaks.com/topic/217967-unexpected-t_lnumber-help-with-syntax-sql/#findComment-1131177 Share on other sites More sharing options...
lakeshoretech Posted November 6, 2010 Author Share Posted November 6, 2010 Yucky - You rock. Yeah, yeah... I know, it's obvious. But not after you've stared at it for 3 hours. Thanks again. Link to comment https://forums.phpfreaks.com/topic/217967-unexpected-t_lnumber-help-with-syntax-sql/#findComment-1131180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.