note 22970 added to function.mssql-query

From: Date: Fri, 05 Jul 2002 16:40:19 +0000
Subject: note 22970 added to function.mssql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-32639@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 -- http://www.php.net/manual/en/function.mssql-query.php http://master.php.net/manage/user-notes.php?action=edit+22970 http://master.php.net/manage/user-notes.php?action=delete+22970 http://master.php.net/manage/user-notes.php?action=reject+22970

« previous php.notes (#32639) next »