Jump to content

unexpected T_LNUMBER - - Help with syntax SQL


lakeshoretech

Recommended Posts

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++;
}
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.