28.12.2010, 07:45
Hello everyone,
So I have a problem with string loading with MySQL. Then I set my variable to string everything is ok. MySQL inserts it to table and everything looks nice. But when I need to load that string MySQL loads for me only one word, not all sentence but only one word.
On top I put variable to enum, so it looks like:
Load Script:
So I have a problem with string loading with MySQL. Then I set my variable to string everything is ok. MySQL inserts it to table and everything looks nice. But when I need to load that string MySQL loads for me only one word, not all sentence but only one word.
On top I put variable to enum, so it looks like:
Код:
<..> enum Item { <...> priezastis[ 128 ], // variable. <...> } new playerDB[ MAX_PLAYERS ][ Item ];
Код:
forward LoadPlayer(playerid); public LoadPlayer(playerid) { new fetch[ 256 ], tmpa; format(query, 256, "SELECT * FROM `"TABLENAME"` WHERE id = '%i'", pInfo[playerid][pId]); mysql_query(query); mysql_store_result(); mysql_retrieve_row(); <...> mysql_fetch_field_row(fetch,"Priezastis"); // Reason sscanf(fetch, "s", tmpa); sscanf(fetch, "s[128]", playerDB[playerid][priezastis]); // variable. <...> mysql_free_result(); }