How to pre-tested if recordset empty?

QuestionsHow to pre-tested if recordset empty?
Davor Budimir asked 11 years ago

Hello Abu,

$sqltxt = "SELECT …."
$g-select_command = $sqltxt;
$g-table = $dbtabela;
$g-set_columns($cols);
$out = $g-render("list1");

How do I know if recordset empty (ie no records returned) because then I would not go to the command:
echo $out

Regards,
Davor

3 Answers
Abu Ghufran answered 11 years ago

Hello,

It shows in lower-right side of grid, about how many records are returned.
If there are no records, it shows that message.

However, this is no very presentable, so i've changed it's position at center of grid.
I'm emailing you update, kindly override.

Regards,

Davor Budimir answered 11 years ago

Hello Abu,

Ok, thanks for the update (very nice) but I thought that in the case that there are no returned records I would not at all writing the variable $out (no line code echo $out).

Regards,
Davor

Abu Ghufran answered 11 years ago

In that case, you might have to execute the SQL byself, and put a conditional check on echo $out;
There is no intrinsic function for that.

Your Answer

7 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?