Re: [PHP-DB] Mssql insert problem From: Joe Lloyd (joe <email protected>)
Date: 11/15/00

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 <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>

-- 
*************************************************************************
* 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 <email protected>      joe <email protected>    
*
*    (301) 317-0110                          http://www.soundprint.org 
*
*    Online Manager   -   System Administrator   -    Web Designer     
*
*************************************************************************

-- 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>