Mssql insert problem
| From: | Mike | Date: | Wed, 15 Nov 2000 20:04:20 +0000 |
| Subject: | Mssql insert problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-4451@lists.php.net to get a copy of this message | ||
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