Re: mssql insert

From: Date: Sun, 28 Mar 2004 16:25:39 +0000
Subject: Re: mssql insert
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-33672@lists.php.net to get a copy of this message
$query = "INSERT INTO myTable VALUES ('".$myVar."');'; Check the commas?
Miles At 05:50 PM 3/28/2004 +1200, Martin Ryan wrote:
Got a dumb-ass question for you all. I have got insert queries working with mssql_query($query); except if any of the variables have two or more words. For example: $myVar = "Two or more words"; $query = "INSERT INTO myTable VALUES ('".$myVar."');'; mssql_query($query,$db); The query will only insert "Two". I know the query is correct, because I've echoed it, cut it, and pasted it directly into Query Analyzer and it comes up roses. Cheers muchly, Marty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#33672) next »