19.09.2012, 05:52
The new mysql plugin R7‘s mysql_function_query() makes me very confused.
Could any one please help me?
My old code is as follows:
When I faced with R7, mysql_query is not work
So I change the code to
BUT HOW CAN I return the value "id" to where I'v called the MySQLCheckAccount(name) As the old code did
?
Could any one please help me?
My old code is as follows:
Code:
public MySQLCheckAccount(name[])
{
new query[128],id;
mysql_real_escape_string(name, name);
format(query, sizeof(query), "SELECT id FROM users WHERE `Name` = '%s' LIMIT 1", name);
mysql_query(query);
mysql_store_result();
if (mysql_num_rows()==0) return 0;
else
{
mysql_fetch_row(name);
intid = strval(id);
return id;
}
}
So I change the code to
Code:
public MySQLCheckAccount(name[])
{
new query[128],id;
mysql_real_escape_string(name, name);
mysql_format(query, sizeof(query), "SELECT id FROM users WHERE `Name` = '%s' LIMIT 1", name);
mysql_function_query(Handel,query,true,"onMySQLCheckAccount","","");
}
public onMySQLCheckAccount()
{
cache_get_row(0, 0, tmp), id= strval(tmp);
return 1;
BUT HOW CAN I return the value "id" to where I'v called the MySQLCheckAccount(name) As the old code did????
}
?


