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 | | 927 Viewer | Category : PHP MySql
READ MORE

    Multi select autocomplete jquery example with code

    Multi select autocomplete jquery example with code

    Open Post

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

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

    Open Post

    Laravel 5.3 - Form Input Validation rules example with demo

    Laravel 5.3 - Form Input Validation rules example with demo

    Open Post

    Laravel 5 amazon s3 file upload tutorial - Part 2

    Laravel 5 amazon s3 file upload tutorial - Part 2

    Open Post

    Solved - opencart this merchant is not enabled for auth/settle

    Solved - opencart this merchant is not enabled for auth/settle

    Open Post

    Laravel 5.3 - How to create SEO friendly sluggable URL

    Laravel 5.3 - How to create SEO friendly sluggable URL

    Open Post