Raised This Month: $51 Target: $400
 12% 

please help me table field update


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n0way0out
Junior Member
Join Date: Mar 2013
Old 04-04-2013 , 10:18   please help me table field update
Reply With Quote #1

i am editing user register system plugin. but i need help .

i have one table . table name is register , and there is 5 field name .

1. username , 2 , password , 3 confirmcode , 4 status , 5 , time



i just want that if new player fully connected the server then automatic that status field change to logged_in . and when he disconnect the server his status field automatic change to logged_out.


i try a lot but failed .

here is some code i have tried.
public client_connect( id )
{
new szAuthid[ 34 ]
get_user_authid( id, szAuthid, charsmax( szAuthid ) )
formatex(query, charsmax(query), "UPDATE register SET Status =logged_in WHERE Name = ^"%s^")
SQL_ThreadQuery(g_sqltuple, "QuerySetData", query)
}
n0way0out is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-04-2013 , 12:15   Re: please help me table field update
Reply With Quote #2

Full code

Ps.

UPDATE register SET Status =logged_in WHERE Name = ^"%s^"

>>

UPDATE register SET Status = 1 WHERE Name = ^"%s^"

Its a same.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 04-04-2013 at 12:16.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-04-2013 , 12:59   Re: please help me table field update
Reply With Quote #3

Quote:
Originally Posted by n0way0out View Post
i am editing user register system plugin. but i need help .

i have one table . table name is register , and there is 5 field name .

1. username , 2 , password , 3 confirmcode , 4 status , 5 , time



i just want that if new player fully connected the server then automatic that status field change to logged_in . and when he disconnect the server his status field automatic change to logged_out.


i try a lot but failed .

here is some code i have tried.
public client_connect( id )
{
new szAuthid[ 34 ]
get_user_authid( id, szAuthid, charsmax( szAuthid ) )
formatex(query, charsmax(query), "UPDATE register SET Status =logged_in WHERE Name = ^"%s^")
SQL_ThreadQuery(g_sqltuple, "QuerySetData", query)
}
you dont have a field named "Name"? also you didnt supply a string for %s in formatex and why are you getting the authid when you are not using it?
jimaway is offline
Reply



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 10:24.


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