Raised This Month: $ Target: $400
 0% 

Getting a field using MySQL


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
.Prometheus.
Member
Join Date: Sep 2004
Old 10-12-2004 , 11:25   Getting a field using MySQL
Reply With Quote #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.
.Prometheus. is offline
Send a message via AIM to .Prometheus. Send a message via MSN to .Prometheus.
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode