Db free result

From SA-MP Wiki

Jump to: navigation, search


Free result memory from a db_query


Parameters:
(DBResult:dbresult)
DBResult:dbresultThe result to free


ReturnsReturns 0 if dbresult is null and 1 otherwise.


public OnPlayerText(playerid, text[])
{
        new query[256];
        format(query, sizeof(query), "INSERT INTO chat VALUES ('%d','%s')",playerid,text);
        db_free_result(db_query(CHATDB,query));
        //Note this is a really bad idea to use this code, as it would be easy to inject SQL code into.
        return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • db_free_result: Free result memory from a query
  • db_get_field: Get content of field with specified ID from current result row
Personal tools
In other languages