Mysql cache_get_value() mismatching arguments.
#1

I am getting errors when using cache_get_value() with MySQL 41-4.

Here is the tquery:

Код:
mysql_tquery(g_SQL, "SELECT * FROM usertest WHERE name = 'Dave'", "SeifSelectCallback");
Код:
forward SeifSelectCallback();
public SeifSelectCallback() {
	new id;
	new name[25];
	if (cache_num_rows() > 0) {
		cache_get_value(0, "id", id, 10);
		cache_get_value(0, "name", name, 25);
	}
	print("Id:");
	print(id);
	print("Name:");
	print(name);
	return 1;
}
Here are the errors:
Код:
gamemodes/test.pwn(101) : error 035: argument type mismatch (argument 3)
gamemodes/test.pwn(105) : error 035: argument type mismatch (argument 1)
gamemodes/test.pwn(98) : warning 203: symbol is never used: "id"
i can't figure this out especially because I can't find documentation for R41-4. Thanks in advance!!
Reply
#2

"id" is integer, not a string.
pawn Код:
cache_get_value_int(0, "id", id);
and
pawn Код:
printf("Id: %d", id);
Reply
#3

This should work.

PHP код:
mysql_tquery(g_SQL"SELECT * FROM `usertest` WHERE `name` = 'Dave'""SeifSelectCallback");
forward SeifSelectCallback();
public 
SeifSelectCallback()
{
    new 
idname[25];
    if (
cache_num_rows())
    {
        
cache_get_value_name_int(0"id"id);
        
cache_get_value_name(0"name"namesizeof(name));
    }
    
printf("ID: %d, Name: %s"idname);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)