Raised This Month: $ Target: $400
 0% 

MySQL Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-17-2005 , 07:25  
Reply With Quote #8

This is how I would have done it.

Code:
public client_connect(id) {     new steamid[32]     get_user_authid(id,steamid,31)     new name[32]     get_user_name(id,name,31)     new ip[64]     get_user_ip(id,ip,63,1)         //check for user     userexists = dbi_query(dbc,"SELECT * FROM userinfo WHERE steamid = '%s'",steamid)         if (dbi_num_rows(result) < 1) { //first time, create new entry         result = dbi_query(dbc,"INSERT INTO userinfo (name,steamid,ip,num) values ('%s','%s','%s',1)",name,steamid,ip)         dbi_free_result(result)     }else{ //Record exists         result = dbi_query(dbc,"UPDATE userinfo SET num=num+1 WHERE steamid = '%s'",steamid)         dbi_free_result(result)     }     dbi_free_result(userexists)     return PLUGIN_HANDLED }

and the 48 comment is about this:
you declare the ip as "new ip[64]"
but you create a db field that is "`ip` VARCHAR( 48 ) NOT NULL,"
slurpycof is offline
 



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 09:59.


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