Raised This Month: $ Target: $400
 0% 

Saving variable per variable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-04-2014 , 11:04   Re: Saving variable per variable
Reply With Quote #9

Quote:
Originally Posted by Backstabnoob View Post
No, why? Just create a table such as:
Code:
CREATE TABLE table_itemlist ( 
    authid VARCHAR ( 34 ),
    itemid SMALLINT ( 5 ) UNSIGNED,
    unixtime INT( 11 ),
    INDEX( authid )
)
Then you can freely put any data in it. In the end you'll have something like this:

Code:
+------------------+--------+---------------+
| authid           | itemid | unixtime      |
+------------------+--------+---------------+
| STEAM_0:1:12345  | 1      | 1415781811    |
| STEAM_0:1:12345  | 2      | 1415781848    |
| STEAM_0:1:12345  | 3      | 1415781875    |
| STEAM_0:1:12345  | 5      | 1415781654    |
| STEAM_0:1:45678  | 1      | 1415781823    |
| STEAM_0:1:45678  | 3      | 1415781835    |
| STEAM_0:1:91234  | 1      | 1415787551    |
+------------------+--------+---------------+
But how do I handle the content if I want something like this :

Code:
+------------------+--------+---------------+
| authid           | itemid | unixtime      |
+------------------+--------+---------------+
| STEAM_0:1:12345  | 1,4,6 | 1415781811, 1415781215, 1415781856    |
| STEAM_0:1:12345  | 2      | 1415781848    |
| STEAM_0:1:12345  | 3      | 1415781875    |
| STEAM_0:1:12345  | 5      | 1415781654    |
| STEAM_0:1:45678  | 1      | 1415781823    |
| STEAM_0:1:45678  | 3      | 1415781835    |
| STEAM_0:1:91234  | 1      | 1415787551    |
+------------------+--------+---------------+
People can have multiple items at once.
__________________
Kia 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:47.


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