Raised This Month: $ Target: $400
 0% 

Inserting string into mysql


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
over_mind
Member
Join Date: Aug 2006
Location: Cajun Country!
Old 01-21-2007 , 10:59   Inserting string into mysql
Reply With Quote #1

Hello I'm trying to insert a string into mysql which is:
|playersteamid
I'm making an item that will give you access to a certain door for 10 seconds. This key item uses this following code:

Code:
public item_key(id)
{
    new authid[32], query[256]
    get_user_authid(id,authid,31)


    format(query,255,"UPDATE property SET access=access+%s WHERE doorname='hotel_door_a'",authid) 
    dbi_query(dbc,query)

    client_print(id,print_chat,"You have 10 seconds to open the door")
    set_task(10.0,"remove_key")
    return PLUGIN_HANDLED
}

public remove_key(id)
{
    new authid[32], query[256]
    get_user_authid(id,authid,31)
    
    format(query,255,"UPDATE property SET access=access-%s WHERE doorname='hotel_door_a'",authid)
    dbi_query(dbc,query)

    client_print(id,print_chat,"10 Seconds are up!")
    return PLUGIN_HANDLED
}
The only thing it's been able to do so far is put "|" in the access column but the steam id isn't there. Any help?

Last edited by over_mind; 01-27-2007 at 10:16.
over_mind is offline
Send a message via AIM to over_mind Send a message via MSN to over_mind
over_mind
Member
Join Date: Aug 2006
Location: Cajun Country!
Old 01-27-2007 , 10:17   Re: Inserting string into mysql
Reply With Quote #2

Ok I've updated the code. Now all it can do is put some random numbers into the access column...I don't get it.
over_mind is offline
Send a message via AIM to over_mind Send a message via MSN to over_mind
Reply


Thread Tools
Display Modes

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 22:31.


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