|
Author
|
Message
|
|
Member
|

10-12-2004
, 11:25
Getting a field using MySQL
|
#1
|
It's just stumped me, I know how to do it, but it jsut isn't working, I'm probably doing it wrong.
What I need to do is select a part of a table and the bit in the table will be either 1 or 0, I then get it using mysql_getfield and str_to_num it, the thing is, every time I use the command, I get "MySQL: unkown error" printed to the server console. This is the code:
if(!mysql)
mysqlConnect();
new name[33],query[256],authid[32];
get_user_name(id,name,32);
get_user_authid(id,authid,32);
format(query,255,"SELECT cop FROM users WHERE steamid='%s'",authid);
mysql_query(mysql,query);
new Str[256];
mysql_getfield(mysql,1,Str,255);
new is_cop = str_to_num(Str);
if(is_cop > 0){
And I can connect to the db. No problems there.
|
|
|
|