note 22970 rejected from function.mssql-query by spic

From: Date: Mon, 16 Sep 2002 08:08:21 +0000
Subject: note 22970 rejected from function.mssql-query by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-36733@lists.php.net to get a copy of this message
I have a problem when submitting a large query that contains a bunch of rows which are commented out, like: $sql_query = " SELECT blahblah ... --COMMENT ... --ANOTHER_COMMENT ... FROM blahblah WHERE ... --YET_ANOTHER_COMMENT.. "; .. and so forth. It seems PHP or SQL is neglecting the newline chars I've got in my $sql_query string. I've added \r\n to each line when defining the string, but it seems to ignore this.. The problem, of course, is that when query() runs into the first "--COMMENT" line it thinks everything else in the string is part of this comment! Is there a way around this? Am I doing something wrong?? I need comments in the string because I have a large generic query that I customize with str_replace() before submitting it.. This saves me from having like 30 separate queries. Any help is greatly appreciated! Peo

« previous php.notes (#36733) next »