RE: [PHP-DB] Mssql insert problem

From: Date: Wed, 15 Nov 2000 20:56:03 +0000
Subject: RE: [PHP-DB] Mssql insert problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-4454@lists.php.net to get a copy of this message
Not being an MSSQL expert, I am going to guess that you should probably have quote marks around fields that are supposed to be inserted into the database as text. HTH Sam Masiello System Analyst Chek.Com (716) 853-1362 x289 smasiello@chekinc.com -----Original Message----- From: Mike [mailto:mpeloso@princeton.edu] Sent: Wednesday, November 15, 2000 3:04 PM To: php-db@lists.php.net Subject: [PHP-DB] Mssql insert problem I'm trying to insert a row into an mssql7 db with the following line: $query = "insert into billablehours values ($Date,$Account,$Person,$Hours)"; And I'm getting an error : Warning: MS SQL message: The name 'Mojo' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted. (severity 15) in C:\Inetpub\wwwroot\SqlAdd.php on line 23 Mojo is the value for the $Person variable which is the only varchar field and the only field I'm getting an error on (I think).Its is not the name of a field.What's wrong? The data comes from the following form: <form action="SqlAdd.php" method="post"> <p>Date <input type="text" name="Date" size="40" maxlength="80" value=""></p> <p>Account <input type="text" name="Account" size="10" maxlength="80" value=""></p> <p>Person <input type="text" name="Person" size="50" maxlength="50" value=""></p> <p>Hours <input type="text" name="Hours" size="40" maxlength="80" value=""></p> <input type="submit" value="Submit"> </form> Help and Thanks Mike P ampeloso@att.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#4454) next »