06.12.2016, 01:57
(
Последний раз редактировалось RIDE2DAY; 06.12.2016 в 02:57.
)
Good job maddinat0r, I love mysql_connect_file and cache_insert_id. By the way, how can multiple SQL statements be sent with this plugin? Adding a semicolon after each statement?
Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP код:
/* Query */
mysql_pquery(sql_handle, "SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1", "CheckAccount");
/* CheckAccount Callback */
/* Method #1 */
new results;
if(cache_get_result_count(results))
{
cache_set_result(0);
new rows;
if(cache_get_row_count(rows))
{
if(rows)
{
// Log In
}
else
{
// Register
}
}
}
/* Method #2 */
cache_set_result(0);
new rows;
cache_get_row_count(rows);
if(rows)
{
// Log In
}
else
{
// Register
}