AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Inserting string into mysql (https://forums.alliedmods.net/showthread.php?t=50184)

over_mind 01-21-2007 10:59

Inserting string into mysql
 
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?

over_mind 01-27-2007 10:17

Re: Inserting string into mysql
 
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.


All times are GMT -4. The time now is 22:31.

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