The codeigniter uri string value with hypen was replaced with underscore in query.
For example : http://domain.com//demo1/index.php/class/method/test-product
The URI : test-product was passed into the query with test_product , so the value is empty in the query result.
How to avoid this problem
$this->uri->segment(3)if it is always test-product. It will not make any difference what ever you do withtest-product