MySQL Issues
#1

Hello !

Why it's Don't load Informations ? :/

PHP Code:
    if(rows 0)
    {
        
cache_get_field_content(0"password"PlayerInfo[playerid][pPass]);
        
PlayerInfo[playerid][pKills] = cache_get_field_content_int(0"kills");
        
PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0"deaths");
        
PlayerInfo[playerid][pCash] = cache_get_field_content_int(0"cash");
        
PlayerInfo[playerid][pKicks] = cache_get_field_content_int(0"kicks");
        
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0"admin");
        
PlayerInfo[playerid][pBans] = cache_get_field_content_int(0"bans");
        
PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0"skin");
        new 
plrIP[16];
        
PlayerInfo[playerid][pIP] = GetPlayerIp(playeridplrIPsizeof(plrIP));
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login...",""RED"Welcome Back ! We Miss You here !.\n"WHITE"Please Type You password to get back you rights","Login","Quit");
    } 
Thanks in advence
Reply
#2

Check if(rows).
It's oblivious, open your eyes, You are loading the data with number row 0 and checking if rows > 0 ? How could that be even possible?
Reply
#3

Quote:
Originally Posted by oMa37
View Post
Check if(rows).
It's oblivious, open your eyes, You are loading the data with number row 0 and checking if rows > 0 ? How could that be even possible?
still same error
Reply
#4

Can you show the full code? The query and the function you load the data in.
Also check your mysql log if there is any error.
Reply
#5

Last lines [in the last hour] Mysql_log

PHP Code:
[09:38:53] [WARNINGcache_get_row_count no active cache
[09:38:53] [WARNINGCMySQLHandle::DeleteSavedResult invalid result id ('0')
[
09:38:55] [ERRORCMySQLQuery::Execute - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET `deaths` = '0' SET `skin` = '0' SET `cash` = '0' SET `admin` = '0' SET `kick' at line 1 
Full Querys :

PHP Code:
OnPlayerDisconnect 
format(querylistsizeof(querylist), "UPDATE `accounts` SET `kills` = '%d', `deaths` = '%d', `skin` = '%d', `cash` = '%d',`admin` = '%d', `kicks` = '%d', `bans` = '%d' WHERE `name` = '%s'"PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], GetPlayerSkin(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKicks], PlayerInfo[playerid][pBans], GetName(playerid)); 
PHP Code:
OnDialogReponse:
format(querylistsizeof(querylist), "INSERT INTO `accounts`(`name`, `ip`, `password`, `admin`, `skin`, `kills`, `deaths`, `cash`, `kicks`, `Bans`) VALUES('%s', '%s', '%s', '0', '0', '0', '0', '4000', '0', '0')"GetName(playerid), ipinputtext); 
that good ?
Reply
#6

How you load the data?
Like when the player connect, How you check if the account is exist or not?
Reply
#7

Lol ! i like the pic xD

anyway
PHP Code:
    new query[100], Cache:result;
        
format(query128"SELECT * FROM `accounts` WHERE `name` = '%s'"GetName(playerid));
       
result =  mysql_query(MySQLquery);
    new 
rows cache_get_row_count();
    
cache_delete(result);
    if(
rows)
    {
            
// Is Exists
        
else 
        {
            
// Is not 
         

Data load :

PHP Code:
        cache_get_field_content(0"password"PlayerInfo[playerid][pPass]);
        
PlayerInfo[playerid][pKills] = cache_get_field_content_int(0"kills");
        
PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0"deaths");
        
PlayerInfo[playerid][pCash] = cache_get_field_content_int(0"cash");
        
PlayerInfo[playerid][pKicks] = cache_get_field_content_int(0"kicks");
        
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0"admin");
        
PlayerInfo[playerid][pBans] = cache_get_field_content_int(0"bans");
        
PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0"skin"); 
i put this after if(rows) { // Exist
Reply
#8

I can't fix your code atm because i'm using the phone, But you have to use a threaded way, Take a look on this example script by Konstantinos; CLICKHERE
Reply
#9

Thank You ! i will try this looks like good

+Repped for u time

EDIT: FIXED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! UPDATED to R41 You credits added to script oMa37
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)