Re: Reserved words in mysql/PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Did you try ENCAPSULATING the field names in back-ticks?
e.g.

insert into table (`field1`, `field2`, `field3`... ) values ('value1', 'value2', 'value3', ... );


--- In php-objects@xxxxxxxxxxxxxxx, Joe Forsythe <jforsythe@...> wrote:
>
> I was trying to run a query that was giving me FITS:
> $result = mysql_query("INSERT INTO customer_shipping_address  
> (address_id,customer_id,fname,lname,address,city,state,zip_code,primary) 
>   VALUES ($ship_address_id, 
> $customer_id,'$shipfname','$shiplname','$shipaddress','$shipcity','$ship 
> state',$shipzip,$primary)");
> 
> Good luck EVER making that work:  "primary" is a reserved word.
> 
> So, for the uninitiated, here's a list I just found with some  
> reserved words so you, too, can save yourself the headache.
> 
> http://developer.mimer.com/validator/sql-reserved-words.tml
> --
> Joe
> 
> [Non-text portions of this message have been removed]
>




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux