Raised This Month: $51 Target: $400
 12% 

Compiler freezing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 11-14-2012 , 12:51   Compiler freezing
Reply With Quote #1

PHP Code:
new szTemp[512]
format(szTemp,charsmax(szTemp),"UPDATE `ensports` SET `skill` = '%i', `frags` = '%i', `deaths` = '%i', `rounds` = '%i', `winner_matches` = '%i', `matches_played` = '%i', `bombs_exploded` = '%i', `bombs_defused` = '%i',  WHERE `steamid` = '%s';"g_ePlayerDataid ][ Skill ], g_ePlayerDataid ][ Frags ], g_ePlayerDataid ][ Deaths ], g_ePlayerDataid ][ Rounds  ], g_ePlayerDataid ][ WinnerMatches ], g_ePlayerDataid ][ MatchesPlayed ], g_ePlayerDataid ][ BombsExploded ], g_ePlayerDataid ][ BombsDefused ], szSteamId
If I change "g_ePlayerData[ id ][ Skill ]" to "id" it doesn't freeze anymore and compiles properly so this is probably a line size issue. Any workaround?
__________________
mabaclu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-14-2012 , 19:18   Re: Compiler freezing
Reply With Quote #2

Quote:
Originally Posted by mabaclu View Post
PHP Code:
new szTemp[512]
format(szTemp,charsmax(szTemp),"UPDATE `ensports` SET `skill` = '%i', `frags` = '%i', `deaths` = '%i', `rounds` = '%i', `winner_matches` = '%i', `matches_played` = '%i', `bombs_exploded` = '%i', `bombs_defused` = '%i',  WHERE `steamid` = '%s';"g_ePlayerDataid ][ Skill ], g_ePlayerDataid ][ Frags ], g_ePlayerDataid ][ Deaths ], g_ePlayerDataid ][ Rounds  ], g_ePlayerDataid ][ WinnerMatches ], g_ePlayerDataid ][ MatchesPlayed ], g_ePlayerDataid ][ BombsExploded ], g_ePlayerDataid ][ BombsDefused ], szSteamId
If I change "g_ePlayerData[ id ][ Skill ]" to "id" it doesn't freeze anymore and compiles properly so this is probably a line size issue. Any workaround?
If you think you know why then change what you think is wrong and test again.
__________________
fysiks is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 11-14-2012 , 20:26   Re: Compiler freezing
Reply With Quote #3

It's probably because the line size is too big, but I obviously won't be replacing variables with smaller ones that have nothing to do with what I want. And changing the var name to a smaller one won't work because I'm planning to add more values to that query.
__________________
mabaclu is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-15-2012 , 07:41   Re: Compiler freezing
Reply With Quote #4

Break the query into multiple queries and see if that solves your issue
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 11-15-2012 , 19:07   Re: Compiler freezing
Reply With Quote #5

Thanks for the sugestion, will give it a try and edit this post with the result.

Worked by dividing the query in parts:

PHP Code:
format(szTemp,charsmax(szTemp),"UPDATE `players` SET ")
format(szAddTempcharsmax(szAddTemp), "`skill` = '%i', `frags` = '%i', `deaths` = '%i', `rounds` = '%i', `winner_matches` = '%i'"g_ePlayerDataid ][ Skill ] ,g_ePlayerDataid ][ Frags ], g_ePlayerDataid ][ Deaths ], g_ePlayerDataid ][ Rounds  ], g_ePlayerDataid ][ WinnerMatches ])
add(szTempcharsmax(szTemp), szAddTemp)
format(szAddTempcharsmax(szAddTemp),", `matches_played` = '%i', `bombs_exploded` = '%i', `bombs_defused` = '%i'  WHERE `steamid` = '%s';"g_ePlayerDataid ][ MatchesPlayed ], g_ePlayerDataid ][ BombsExploded ], g_ePlayerDataid ][ BombsDefused ], szSteamId)
add(szTempcharsmax(szTemp), szAddTemp
__________________

Last edited by mabaclu; 11-16-2012 at 11:06.
mabaclu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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