Re: Mssql insert problem
| From: | Joe Lloyd | Date: | Wed, 15 Nov 2000 20:51:42 +0000 |
| Subject: | Re: Mssql insert problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4453@lists.php.net to get a copy of this message | ||
Try:
$query="insert into billablehours values
('$Date','$Account','$Person','$Hours')";
Mike wrote:
>
> 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
--
*************************************************************************
* The theory used to be that you marry an older man because they are
*
* more mature. The new theory is that men don't mature. So you might
*
* as well marry a younger one.
*
*************************************************************************
* Joseph C. Lloyd joe@soundprint.org joe@soundprint.org
*
* (301) 317-0110 http://www.soundprint.org
*
* Online Manager - System Administrator - Web Designer
*
*************************************************************************