new to SQL
#1

I'm experienced with MySQL, but its the first time i am working with SQL.
pawn Код:
stock GetAchievementDescription(Achievement[])
{
      new query[128];
      format(query,128,"SELECT Description FROM Achievements WHERE FullName = '%s'",Achievement);
      JA_Result=db_query(JA_Database,query);
      db_get_field(JA_Result,0,query,128);
      db_free_result(JA_Result);
      return query;
}
This code returns the query, but not the fetched data from the field.
Reply
#2

https://sampwiki.blast.hk/wiki/Db_get_field_assoc
Reply
#3

I suggest loading this only once, and saving it into a variable, instead of always load it when need to.
Reply
#4

pawn Код:
stock GetAchievementDescription(Achievement[])
{
      new query[128], result[128];
      format(query,512,"SELECT Description FROM Achievements WHERE FullName = '%s'",Achievement);
      JA_Result=db_query(JA_Database,query);
      db_get_field_assoc(JA_Result,"Description",result, 128);
      db_free_result(JA_Result);
      return result;
}
Still the same
Reply
#5

Is database even opened? Is description valid field. Is query actually valid? Have you run query in database manager and got result?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)