Return a Query-Callback result
#1

Hi, is there a method to return a query-callback result? For example:

Код:
test()
{
    mysql_tquery(connectionHandle, "SELECT * FROM `example`", "foo", "");
    //HERE I WANT TO KNOW WHAT FOO GAVE BACK
}

foo()
{
    if(cache_num_rows() > 0)
        return 1;
    return 0;
}
Reply
#2

If you want to just check if there is any row, use "SELECT COUNT(*) FROM ..." and retrieve the rows returned with cache_get_row_int (rowid 0). That way, you won't select ALL the data for nothing.

For now, if you want to have a function that returns 0/1 the only way is non-threaded queries. In R40, there'll be support for references by the way.
Reply
#3

As I expected.. thanks for the answer!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)