Hello
How I can hide table if the sql query is empty?
I tried this one
[php]<?php if(!empty($queryRC)) { ?>
//my table
[/php]
i also tried this one
[php]<?php if($queryRC !="" ) { ?>
//my table
[/php]
And both did not work for me
Hello
How I can hide table if the sql query is empty?
I tried this one
[php]<?php if(!empty($queryRC)) { ?>
//my table
[/php]
i also tried this one
[php]<?php if($queryRC !="" ) { ?>
//my table
[/php]
And both did not work for me
QJK,
Assuming $queryRC contains your result from the query, you can do this…
If you’re using mysqli
[php] <?php if (mysqli_num_rows($queryRC) > 0) { ?>
//my table
or this is you’re using the depreciated methods
[php] <?php if (mysql_num_rows($queryRC) > 0) { ?>
//my table
If you’re using PDO then you will use the fetchColumn method…
PDOStatement::fetchColumn