Re: inserting into MS SQL database- query failed

From: Date: Wed, 29 Aug 2001 15:35:32 +0000
Subject: Re: inserting into MS SQL database- query failed
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-9118@lists.php.net to get a copy of this message
Try using single quotes for the columns in your query: $SQL = " INSERT INTO $table_name (f_name, l_name, username, password) VALUES ('$f_name', '$l_name', '$username', '$password') "; SQL SERVER doesn't accept double quotes - I wonder how you were able to run the query in Query Analyzer witrh double quotes Andrian Joann Coffey wrote: > > I am trying to insert some data from an html form to a php script (using MS > SQL, PWS on Win 98, PHP 4.0.5 cgi) - but I keep getting the following > error: > > Warning: MS SQL: Query failed in C:\Inetpub\wwwroot\php\do_adduser.php on > line 24 > > When I executed the query using Query analyzer the record was added to the > dbase but when trying to submit the info through the form it is not > successful - I would appreciate any help as I am not sure how to find out > what the problem is. > > Here is the insert statement from do_adduser.php > > $SQL = " > INSERT INTO $table_name > (f_name, l_name, username, password) > VALUES > (\"$f_name\", \"$l_name\", \"$username\", > \"$password\") > "; > > Thank you. > > Joann > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#9118) next »