AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dbi_num_rows help (https://forums.alliedmods.net/showthread.php?t=27721)

nhdriver4 04-27-2006 18:15

dbi_num_rows help
 
In the following code snip, I can't seem to get "total" to print. I've tried many different things, with no results. Anyone have any ideas?


Code:
format(query, 350, "SELECT id, name  FROM `%s` WHERE `id` = %s", table_names, pid) new Result:result = dbi_query(sql, "%s", query) new total = dbi_num_rows(result) if (result >= RESULT_OK) {     new names[33]                 client_print(id, print_console, " ")     client_print(id, print_console, "[IDTRACKER] You ran a search on %s", authid)     client_print(id, print_console, "[IDTRACKER] %s's id # is %s", authid, pid)     client_print(id, print_console, "[IDTRACKER] %s has %s names associated", pid, total)     client_print(id, print_console, "==============================================")     while ( dbi_nextrow(result) > 0 ) {         dbi_result(result, "name", names, 32)         client_print(id, print_console, "%s", names)     }     client_print(id, print_console, "==============================================")     client_print(id, print_console, " ")     dbi_free_result(result)     return PLUGIN_HANDLED

Des12 04-27-2006 19:20

Shouldn't you use %i to print out numbers?

nhdriver4 04-27-2006 19:23

Thanks Des12. +Rep for you.


All times are GMT -4. The time now is 05:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.