Issue with mysql_fetch_int
#1

I've used this in my code:

Код:
mysql_fetch_int("jail_time", jailtime);
Here's the error I got:

Код:
C:\Users\Rhys\Desktop\scripting\gamemodes\sheriffs.pwn(245) : error 035: argument type mismatch (argument 1)
Any ideas? I'm trying to retrieve the jail_time field from the database and store it into the jailtime variable

I'm using this mysql plugin: https://sampwiki.blast.hk/wiki/MySQL_Plugin
Reply
#2

You seem to be using the wrong syntax.

Check this out:
(This is from my script)

Quote:

new query[256];
format(query, sizeof(query), "SELECT %s FROM %s WHERE id = %d LIMIT 1", fieldname, tablename, sqlid);
mysql_query(query);
mysql_store_result();
new result = mysql_fetch_int();
mysql_free_result();
return result;

You may also wanna check out this page:

https://sampwiki.blast.hk/wiki/MySQL#mysql_fetch_int
Reply
#3

Thank you, this has returned no errors. Got a bit confused with that. Many thanks. +1
Reply
#4

No problem, although I'd advise you to talk to Vince if you have issues with MySQL. He's pretty good with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)