Errors remove while retrieving results are blank in php:
Errors remove in PHP: in your PHP web pages, when you fetch data from database and display a view table page, if fetch result return zero or blank the it’s will show an error. This tutorial will help you to remove while retrieving results from MySQL table using PHP programming language.
You can use empty function for solve this problem. Empty function helps you to remove error message from your webpage, when return value false in PHP. Follow the example:
Errors remove using empty function in PHP:
<?php if(!empty($get_val)){ foreach ($get_val as $p_value) { // Display results.... } }else{ echo ""; } ?>
Or try it:
<?php if($get_val >0){ foreach ($get_val as $p_value) { // Display results.... } }else{ echo ""; } ?>
Related posts