MySQL R33+ (small help)
#3

Quote:
Originally Posted by HazardouS
Посмотреть сообщение
Here you go:
https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_tquery

Basically you're sending the query and you're calling a function when the query executes (successfully or not).
pawn Код:
mysql_tquery(connectionHandle, "SELECT Banned FROM players WHERE user = Bondage", "QueryResultCallback", "i", playerid); //passing the playerid as parameter to be able to send him a message if he's banned

public QueryResultCallback(playerid) //the only param of this function is playerid, which has been passed from the query
{
  //get the number of rows
  if(rows) // he's banned
  {
    //something - here you can use playerid to send the player a message and maybe kick him
  }
  else
  {
    //he's not banned - send a welcome message, call a login system if required etc
  }
}
Looks like there are 2 ways of getting the number of rows. Maybe there are more, but I only found these two:
[1] https://sampwiki.blast.hk/wiki/MySQL/R33..._get_row_count
[2] https://sampwiki.blast.hk/wiki/MySQL/R33#cache_get_data
Is this work along with any versions above R33?
Reply


Messages In This Thread
MySQL R33+ (small help) - by Bondage - 13.01.2015, 16:09
Re: MySQL R33+ (small help) - by HazardouS - 13.01.2015, 16:24
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 16:27
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 18:40
Re: MySQL R33+ (small help) - by bgedition - 13.01.2015, 19:59
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 21:18
Re: MySQL R33+ (small help) - by HazardouS - 13.01.2015, 21:51
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 22:04

Forum Jump:


Users browsing this thread: 3 Guest(s)