20.04.2011, 12:47
Whenever i add the db_free_result function in this code, my pawn gives me a [Don't Send] error, and get's frustrating as i don't want memory leaks.
Any ideea that could cause this? I'm new into SQL and i still learn about it.
PS: That's from inside my /mute command.
pawn Код:
new
pQue[ 256 ];
format( pQue, sizeof (pQue), "SELECT * FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx( params[ 0 ] ) );
new DBResult:RESULT = db_query( UsefullDatabase, pQue );
P_DATA[ params[ 0 ] ][ Muted ] = 1;
P_DATA[ params[ 0 ] ][ MutedTime ] = 0;
new pQue2[ 256 ];
if ( db_num_rows( RESULT ) )
format( pQue2, sizeof (pQue2),"UPDATE `Muted` SET `IP` = '%s', `Muted` = '1', `Time` = '0', `RealName` = '%s'",GetPlayerIPEx( params[ 0 ] ), Name( params[ 0 ] ) );
else
format( pQue2, sizeof (pQue2), "INSERT INTO `Muted` ( `IP`, `Muted`, `Time`, `RealName` ) VALUES ('%s', '1', '0', '%s')", GetPlayerIPEx( params[ 0 ] ), Name( params[ 0 ] ) );
db_query( UsefullDatabase, pQue2 );
db_free_result( RESULT );
PS: That's from inside my /mute command.