Tag : SUBSTRING_INDEX()


How to get filename from file path in MySQL?

Sometimes we require to get filenames from path of table column in MySQL. If you are working on PHP then you can simply use basename() pre-define function of code PHP, But in MySQL you can't use basename() in select query. This mysql function you can use in code PHP, PHP framework like laravel, codeigniter etc. However, you can get simply filename or image name from path using SUBSTRING_INDEX() of MySQL. You can extract filename from path using substring_index(), substring_index() take three argument, first for column name, second for split string chat, and third get last element from split. .....

By Hardik Savani | November 30, 2016 | | 3055 Viewer | Category : PHP MySql
READ MORE

    Angularjs nl2br(textarea newline and linebreak conversion) example with demo

    Angularjs nl2br(textarea newline and linebreak conversion) example with demo

    Open Post

    Solved - Access Not Configured. Google+ API (truncated...) on google console developer

    Solved - Access Not Configured. Google+ API (truncated...) on google console developer

    Open Post

    Laravel 5 - user prevent common passwords using laravel-password package

    Laravel 5 - user prevent common passwords using laravel-password package

    Open Post

    Laravel 5 create word document file using phpoffice/phpword package

    Laravel 5 create word document file using phpoffice/phpword package

    Open Post

    PHP Laravel 5 - Sub-domain routing file Example

    PHP Laravel 5 - Sub-domain routing file Example

    Open Post

    PHP - multiple file uploading dropzone js example

    PHP - multiple file uploading dropzone js example

    Open Post