Can someone help me out?
| From: | ReClMaples | Date: | Tue, 07 Jun 2005 23:04:55 +0000 |
| Subject: | Can someone help me out? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-39602@lists.php.net to get a copy of this message | ||
I am having a problem getting a sql statement to run.
I have this in a table called stat_categories, in a field called sql2
select a.name,a.position,a.team,sum(b.yards) as Results from player
a,passing b
where
a.player_num = b.player_num
and a.position = '$pos'
and b.year >= '$year'
group by a.name
order by Results desc
limit '$display'
when I try to display this I get this 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 ''$display'' at
line 8
I tried removing the s but this didnt help.
If I put in the sql instead of the variable, it works fine. What am I doing
wrong?
Any help would be greatly appreciated.
Thanks
-Rich