need some help with a MySQL Connection
#8

This is how I do it:
pawn Код:
stock CheckAccount(playerid)
{
  MySQLCheck();

  new
    query[70];

  format(query, sizeof(query), "SELECT * FROM `players` WHERE Nickname = '%s'", Player[playerid][Name]);
  mysql_query(query);
  mysql_store_result();
  if(mysql_num_rows() > 0) Player[playerid][Registered] = 1;
  else Player[playerid][Registered] = 0;
  mysql_free_result();
}
pawn Код:
public OnPlayerConnect(playerid)
{
  ...
  CheckAccount(playerid);
  if(Player[playerid][Registered] == 1) BlaBlaBla;
  else BlaBlaBla2;
  return 1;
}
Reply


Messages In This Thread
need some help with a MySQL Connection - by TheChaoz - 06.03.2010, 03:27
Re: need some help with a MySQL Connection - by Miguel - 06.03.2010, 04:06
Re: need some help with a MySQL Connection - by TheChaoz - 06.03.2010, 04:20
Re: need some help with a MySQL Connection - by Miguel - 06.03.2010, 04:25
Re: need some help with a MySQL Connection - by TheChaoz - 06.03.2010, 04:26
Re: need some help with a MySQL Connection - by Miguel - 06.03.2010, 04:28
Re: need some help with a MySQL Connection - by TheChaoz - 06.03.2010, 04:34
Re: need some help with a MySQL Connection - by Miguel - 06.03.2010, 04:43
Re: need some help with a MySQL Connection - by TheChaoz - 06.03.2010, 04:57
Re: need some help with a MySQL Connection - by Miguel - 06.03.2010, 05:05

Forum Jump:


Users browsing this thread: 3 Guest(s)