Re: Can someone help me out?
| From: | Brad Webb | Date: | Tue, 07 Jun 2005 23:59:00 +0000 |
| Subject: | Re: Can someone help me out? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39604@lists.php.net to get a copy of this message | ||
Is your query wrapped in single quotes, instead of double quotes? Variable expansion, of course, doesn't occur under single quotes. :)
ReClMaples wrote:
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 didn’t 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