For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2004 > Re: [PHP-DB] mssql insert









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] mssql insert
Miles Thompson

2004-03-28, 10:09 pm

>$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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com