I am trying to update a new field with a field named 'filename' but only want the left charactors (length of what it is -4)
I am a newbi! Please help
UPDATE photographs SET basefilename = substr(filename,0,lengh(filename)-4)
syntax for UPDATE statment?
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: syntax for UPDATE statment?
You misspelled "lengh" ... it is length. Also, make sure you are not mixing up SQL functions and PHP functions. You can put SQL functions into the query string, but PHP functions need to be called in the script. The output of the PHP functions is put into a variable which is then put in the query string.
(#10850)