08.12.2011, 06:31
Well the two functions are 'mysql_store_result();' and 'mysql_free_result();'
I've heard many people saying that if no result was found, then it doesn't make sense to use 'mysql_free_result'.
Here's an example:
I want to know if it's correct to use 'mysql_free_result();' within 'if(mysql_num_rows() == 0);'
I've heard many people saying that if no result was found, then it doesn't make sense to use 'mysql_free_result'.
Here's an example:
pawn Код:
for(new i = 1; i<MAX; i++)
{
format(String,sizeof(String),"SELECT `ID` FROM table WHERE `ID` = %d LIMIT 1",i);
mysql_query(String);
mysql_store_result();
if(mysql_num_rows() == 0)
{
mysql_free_result();
continue;
}
if(mysql_num_rows() != 0)
{
//do something
mysql_free_result();
}
}