Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

MYSQL R39 to R41 Convert Help

$
0
0
PHP Code:

format(buffer,sizeof(buffer),"SELECT round(SUM(money)) FROM pe_characters WHERE money > 0");
results mysql::query(dbHandle,buffer);
cache_get_row(0,0,sum_money);

format(buffer,sizeof(buffer),"SELECT round(SUM(bank)) FROM pe_characters WHERE bank > 0");
results mysql::query(dbHandle,buffer);
cache_get_row(0,0,sum_bank);

format(buffer,sizeof(buffer),"SELECT abs(round(SUM(money))) FROM pe_characters WHERE money < 0");
results mysql::query(dbHandle,buffer);
cache_get_data(sqlRows,sqlFields);
if(
sqlRows){
    
cache_get_row(0,0,dlug_money);
    if(
ismysqlnull(dlug_money)) dlug_money "0";
} else {
    
dlug_money "0";
}

format(buffer,sizeof(buffer),"SELECT abs(round(SUM(bank))) FROM pe_characters WHERE bank < 0");
results mysql::query(dbHandle,buffer);
cache_get_data(sqlRows,sqlFields);
if(
sqlRows){
    
cache_get_row(0,0,dlug_bank);
    if(
ismysqlnull(dlug_bank)) dlug_bank "0";
} else {
    
dlug_bank "0";
}
cache_delete(results); 

Converted to R41
PHP Code:

mysql_format(g_SQL,buffer,sizeof(buffer),"SELECT round(SUM(money)) as sum_money FROM users WHERE money > 0");
    
results mysql_query(g_SQL,buffer,true);
    
cache_get_value_name(0,"sum_money",sum_money);
    
cache_delete(results);
    
    
mysql_format(g_SQL,buffer,sizeof(buffer),"SELECT round(SUM(bankcash)) as sum_bank FROM users WHERE bankcash > 0");
    
results mysql_query(g_SQL,buffer,true);
    
cache_get_value_name(0,"sum_bank",sum_bank);
    
cache_delete(results);
    
    
mysql_format(g_SQL,buffer,sizeof(buffer),"SELECT abs(round(SUM(money))) as debt_money FROM users WHERE money < 0");
    
results mysql_query(g_SQL,buffer,true);
    
cache_get_row_count(sqlRows);
    if(
sqlRows){
        
cache_get_value_name(0,"debt_money",debt_money);
        
cache_is_value_name_null(0,"debt_money",m_isnull);
        if(
m_isnull || isnull(debt_money)) debt_money "0";
    } else {
        
debt_money "0";
    }
    
cache_delete(results);
    
    
mysql_format(g_SQL,buffer,sizeof(buffer),"SELECT abs(round(SUM(bankcash))) as debt_bank FROM users WHERE bankcash < 0");
    
results mysql_query(g_SQL,buffer,true);
    
cache_get_row_count(sqlRows);
    if(
sqlRows){
        
cache_get_value_name(0,"debt_bank",debt_bank);
        
cache_is_value_name_null(0,"debt_bank",m_isnull);
        if(
m_isnull || isnull(debt_bank)) debt_bank "0";
    } else {
        
debt_bank "0";
    }
    
cache_delete(results); 

Whats the problem here? Any help would be appreciated

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>