Hello, i'm new to the MySQL system in SA-MP, and since it's not very similar to PHP's MySQL, I have some syntax issues.
What I basicly want to do is take information from my MySQL database and print them out in PAWNO.
Here's my database:
Above OnGameModeInit:
OnGameModeInit:
I've tried different variations of cache_get_value and i've also tried to do it with & without sizeof().
Console prints:
What I basicly want to do is take information from my MySQL database and print them out in PAWNO.
Here's my database:
Above OnGameModeInit:
Quote:
forward sqlConnection(); public sqlConnection() { return mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS); } |
OnGameModeInit:
Quote:
new connection = sqlConnection(); printf("CONNECTION: '%i'", connection); new Cache:result = mysql_query(connection, "SELECT username FROM player"); new playerName[MAX_PLAYER_NAME]; cache_get_value_name(0, "username", playerName, sizeof(playerName)); printf("PLAYER_NAME: '%s'", playerName); |
Console prints: