AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 3: stack error (https://forums.alliedmods.net/showthread.php?t=332584)

erickvan 05-21-2021 00:52

Run time error 3: stack error
 
Hello guys. I need to read file from .txt. In .txt i have text like "H434". I need to print that "H434" text and update mysql by that text. So i try do like that:

PHP Code:

public UpdateMysql()
{
new 
szQuery[3800];
new 
szDirectory[128];
get_configsdirszDirectorycharsmaxszDirectory ) )
addszDirectorycharsmaxszDirectory ), "/text.txt" )

new 
size file_sizeszDirectory)  

new 
readMatchID[28], iLen

for ( new size i++ ) 

read_fileszDirectoryireadMatchIDcharsmaxreadMatchID ), iLen )
}
formatex(szQuery3799"UPDATE `matches` SET (`left_score` = '%s', `right_score` = '%s', `updated_at` = NOW()) WHERE (match_id = '%s');"score1score2readMatchID);  
SQL_ThreadQueryg_hTuple"QuerySetData"szQuery);


Bu getting error: Run time error 3: stack error
Line error:

PHP Code:

new readMatchID[28], iLen 

Any help?

Shadows Adi 05-21-2021 08:59

Re: Run time error 3: stack error
 
PHP Code:

new szQuery[3800

Declare this variable globally or reduce it's size if you want to use it locally.

lexzor 05-22-2021 12:06

Re: Run time error 3: stack error
 
Quote:

Originally Posted by Shadows Adi (Post 2747387)
Declare this variable globally or reduce it's size if you want to use it locally.

Don't use a higher size than 2000.

Check my topic for more informations: https://forums.alliedmods.net/showthread.php?t=332390


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

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