RE: [PHP-DB] Can someone help me out?
| From: | Bastien Koert | Date: | Wed, 08 Jun 2005 00:21:02 +0000 |
| Subject: | RE: [PHP-DB] Can someone help me out? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39605@lists.php.net to get a copy of this message | ||
can you show the code around it? are you using single quotes in defining the sql statement? or double quotes?
Bastien
From: "ReClMaples" <reclmaples@sbcglobal.net> To: "Jason Walker" <desktophero@cox.net> CC: "PHP" <php-db@lists.php.net> Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: 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 and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -----Original Message----- From: Jason Walker [mailto:desktophero@cox.net] Sent: Tuesday, June 07, 2005 6:54 PM To: 'ReClMaples' Subject: RE: [PHP-DB] Can someone help me out? In your PHP page, can you echo the actual query variable to the browser and send that to the mail group? I don't necessary see anything 'wrong' with your query but see the three variables, as they are interpreted by PHP, may help. Thanks, -----Original Message----- From: ReClMaples [mailto:reclmaples@sbcglobal.net] Sent: Tuesday, June 07, 2005 4:05 PM To: PHP Subject: [PHP-DB] Can someone help me out? 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 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 6/7/2005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php