Page 1 of 1

UPDATE statment

Posted: Fri Apr 23, 2010 1:48 pm
by mudge.steve
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)

Re: UPDATE statment

Posted: Fri Apr 23, 2010 5:42 pm
by mikosiko
seems to me that you are trying to get just the filename without extension right?... if so... look here
http://php.net/manual/en/function.basename.php

and scroll down to the second example