Check if table exsits.
Hello folks. Can someone do for me? I cant figure it out. I have code:
PHP Code:
|
Re: Check if table exsits.
In your CREATE TABLE script, use the below to define steam_id:
Code:
steam_id varchar(34) UNIQUECode:
REPLACE INTO users_maps (steam_id, session_id, map) VALUES ('%s', '%s', '%s' );", steam, readMatchID, map_name); |
Re: Check if table exsits.
Quote:
|
Re: Check if table exsits.
Quote:
|
Re: Check if table exsits.
If you did what I told you to do correctly it would do exactly what you want.
Something like this: Code:
CREATE TABLE IF NOT EXISTS users_maps (ID INTEGER PRIMARY KEY AUTOINCREMENT, steam_id VARCHAR(34) UNIQUE, session_id VARCHAR(12), map VARCHAR(32));Code:
REPLACE INTO users_maps (steam_id, session_id, map) VALUES ('%s', '%s', '%s' );", steam, readMatchID, map_name);REPLACE INTO users_maps (steam_id, session_id, map) VALUES ('STEAM_0:0:12345', 'testID1', 'map1" ); Calling this would over-write STEAM_0:0:12345's existing record with testID2 and map2 (technically delete the old and insert new) REPLACE INTO users_maps (steam_id, session_id, map) VALUES ('STEAM_0:0:12345', 'testID2', 'map2" ); |
| All times are GMT -4. The time now is 02:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.