Mysql R39
#1

Im updating the mysql from old, old version and I have a question how should I replace this

Код:
if ( mysql_num_rows( ) > 0 )
in R39 version? I usually use cache_get_data but not like with <> and etc.
Reply
#2

cache_num_rows/cache_get_row_count (same thing)
https://sampwiki.blast.hk/wiki/MySQL/R33..._get_row_count

You can check for all the functions on the wiki.
Reply
#3

So I should just paste cache_num_rows without any (...) ? Any btw. I did research cannot find which R39 changes mysql_retrieve_row this to?
Reply
#4

mysql_retrieve_row becomes a loop with cache_get_row_count:
pawn Код:
for (new i, j = cache_get_row_count(); i != j; i++)
{
    // "i" is the "rowid" for cache functions
}
Reply
#5

Change it to
Код:
if (cache_num_rows() > 0)
And I don't know what mysql_retrieve_row is now, but what you can do is this:
Код:
for (new i = 0, j = cache_num_rows(); i < j; i++)
{
    // 'i' is your current row
}
EDIT: Sorry Konstantinos, again.. (lol)
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
mysql_retrieve_row becomes a loop with cache_get_row_count:
pawn Код:
for (new i, j = cache_get_row_count(); i != j; i++)
{
    // "i" is the "rowid" for cache functions
}
Код:
	if ( mysql_num_rows( ) > 0 )
    {
        while( mysql_retrieve_row( ) )
        {
Can you change this for example? Thanks for helping out.
Reply
#7

Quote:
Originally Posted by Bailews
Посмотреть сообщение
Код:
	if ( mysql_num_rows( ) > 0 )
    {
        while( mysql_retrieve_row( ) )
        {
Can you change this for example? Thanks for helping out.
Код:
new rows = cache_num_rows();
if (rows)
{
    for (new i = 0; i < rows; i++)
    {

    }
}
Reply
#8

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Код:
new rows = cache_num_rows();
if (rows)
{
    for (new i = 0; i < rows; i++)
    {

    }
}
Thanks if you have time check PM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)