Date: 11/15/00
- Next message: jeffM <email protected>: "[PHP-DB] HTTP 404 ERROR"
- Previous message: Joe Lloyd: "Re: [PHP-DB] Mssql insert problem"
- In reply to: Mike: "[PHP-DB] Mssql insert problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected>
-----Original Message-----
From: Mike [mailto:mpeloso <email protected>]
Sent: Wednesday, November 15, 2000 3:04 PM
To: php-db <email protected>
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 <email protected>
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: jeffM <email protected>: "[PHP-DB] HTTP 404 ERROR"
- Previous message: Joe Lloyd: "Re: [PHP-DB] Mssql insert problem"
- In reply to: Mike: "[PHP-DB] Mssql insert problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

