Recover a value[mysql]
#4

Quote:
Код:
mysql_format(mysql, query, sizeof(query), "SELECT `posX`, `posY` FROM `joueurs` WHERE `posX` = '%f', `posY` = '%f'", pInfo[playerid][posX], pInfo[playerid][posY]);
mysql_tquery(mysql, query, "", "");
printf("%f %f %d %d", pInfo[playerid][posX], pInfo[playerid][posY]);
  1. your query doesn't really makes any sense
  2. that query will also likely never return any result, because you are comparing float values (very bad)
  3. even if this query would return some valid values, do you expect these values are auto-magically assigned to their correct variables? Only the ORM system can do this.
tl;dr: You should try to understand how threaded queries work and how to use the cache_* (cache_get_row, cache_get_field_content, ...) natives.
If you don't really care about understanding how to use it and how it works, you can alternatively take a look at the ORM system. Once set up, it should make your life easier.
Reply


Messages In This Thread
Recover a value[mysql] - by anou1 - 13.01.2014, 17:24
Re: Recover a value[mysql] - by maddinat0r - 13.01.2014, 17:42
Re : Recover a value[mysql] - by anou1 - 13.01.2014, 17:56
Re: Recover a value[mysql] - by maddinat0r - 13.01.2014, 18:10
Re : Recover a value[mysql] - by anou1 - 13.01.2014, 18:40
Re: Recover a value[mysql] - by sammp - 13.01.2014, 22:24
Re: Recover a value[mysql] - by anou1 - 13.01.2014, 22:37
Re: Recover a value[mysql] - by anou1 - 14.01.2014, 09:46
Re: Recover a value[mysql] - by sammp - 14.01.2014, 18:10
Re : Recover a value[mysql] - by anou1 - 14.01.2014, 20:46

Forum Jump:


Users browsing this thread: 1 Guest(s)