MYSQL.
#1

Hi,

If am loading a something, can i write anything to database:

Код:
mysql_query( "SELECT Name FROM players ORDER BY XP" );
		mysql_store_result( );
		new NAMESAVE[ MAX_PLAYER_NAME ];
		new STRINGSAVE[ 50 ];
		new STRING2[ 128 ];
		while( mysql_fetch_row_format( STRINGSAVE ) )
		{
	    	sscanf(STRINGSAVE,"p<|>s[24]",NAMESAVE );
	    	
	    	format(STRING2,128,"UPDATE players SET Playtime='0' WHERE Name = '%s'", NAMESAVE );
			mysql_query(STRING2);
		}
		mysql_free_result( );
It's it work?
Reply
#2

No, you must free the result first. You will get out of sync errors if you try to do this. I'm not sure why you would want to reset everyone's playing time, but your query can easily be rewritten to:
PHP код:
UPDATE players SET playtime=
Reply
#3

Realy!! thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)