Re: Another PHP/SQL Query Question...

From: Date: Mon, 17 Jun 2002 18:20:45 +0000
Subject: Re: Another PHP/SQL Query Question...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-102555@lists.php.net to get a copy of this message
Hi Dennis. Yeah, I guess I should have made that clear. I *am* echoing the query string before executing for debugging purposes. It looks exactly like the handwritten one (unless there are some hidden characters somwhere). This seems so simple to me, yet it's not working. I'd feel a lot better if echoing the query showed something to be messed up, but it's just not the case. The thing is, I don't think that there's anything wrong with my setup so I assume that others have seen this issue as well. Thanks, Dennis. Michael ----- Original Message ----- From: "Dennis Moore" <dmoore@ravens-nest.com> To: "Michael" <michaeln@twentyten.org>; <php-general@lists.php.net> Sent: Monday, June 17, 2002 11:24 AM Subject: Re: [PHP] Another PHP/SQL Query Question... > How are you generating your query string? It looks as though your array > value is not set or is not being properly added to your query string. > > YOu may want to try echoing your query string before executing it to verify > that it is properly formated. > > Just a thought... > > > ----- Original Message ----- > From: "Michael" <michaeln@twentyten.org> > To: <php-general@lists.php.net> > Sent: Monday, June 17, 2002 1:28 PM > Subject: [PHP] Another PHP/SQL Query Question... > > > > Hey guys, I'm having another SQL issue... I'm currently using PHP, > FreeTDS, > > and Sybase libraries to > > access a database on an MS SQL 2000 server. This is the query I'm trying > to > > make: > > > > SELECT Servers.Name, ServerProfiles.Name FROM ServerProfiles INNER JOIN > > Servers on ServerProfiles.ServerProfileID = Servers.Profile WHERE > > (((Servers.Name)='$server[0]')) > > > > The resulting error is as follows: > > > > "Sybase error: Unclosed quotation mark before the character string > > 'mailserver01'. (severity 15)" > > "Sybase error: Line 1: Incorrect syntax near 'mailserver01'. (severity > 15)" > > > > The thing is, if I type the query with the server anme instead of the > > variable, it works! > > > > SELECT Servers.Name, ServerProfiles.Name FROM ServerProfiles INNER JOIN > > Servers on ServerProfiles.ServerProfileID = Servers.Profile WHERE > > (((Servers.Name)='mailserver01')) > > > > I printed the query to make sure that it is indeed the same query as > above, > > and it appears to be. I'm sure I'm missing a little nuance here. Could > > someone help me out? > > > > Also, is there a good resource for looking up little nuances such as this? > > You know, reminders regarding which characters to escape, which quote > types > > to use etc. I really feel bad about bugging you guys like this on > subjects > > that are probably pretty basic. ;-) > > > > > > Michael > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#102555) next »