need some help with a MySQL Connection
#9

don't know what i'm doing wrong

pawn code:
pawn Код:
public OnPlayerConnect(playerid)
{
  CheckAccount(playerid);
  //code....
  return 1;
}
pawn Код:
stock ConexionMySQL()
{
  if(mysql_ping() == 0)
  {
    return true;
  }
  else
  {
    mysql_reload();
    ConexionMySQL();
  }
  return false;
}

//----------------------------------------------------------------------------------
stock CheckAccount(playerid)
{
  ConexionMySQL();

  new query[70], playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername, sizeof(playername));
  format(query, sizeof(query), "SELECT * FROM `usuarios` WHERE UserName = '%s'", playername);
  mysql_query(query);
  mysql_store_result();
  if(mysql_num_rows() > 0) PlayerInfo[playerid][Registered] = 1;
  else PlayerInfo[playerid][Registered] = 0;
  mysql_free_result();
}
log:
Код:
[02:46:04] Incoming connection: 127.1.1.1:2841
[02:46:04] [join] The_Chaoz has joined the server (0:127.1.1.1)
[02:46:04] MySQL Error (0): Could not execute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''usuarios' WHERE UserName=The_Chaoz' at line 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: 1 Guest(s)