Jump to content

Archived

This topic is now archived and is closed to further replies.

supanoob

Row Types

Recommended Posts

well, anyway i want to be able to insert several things into one row.. like a list of items. now i dont know what type of field my items should go into. and i dont how i should update them. since a normal UPDATE script in php takes out whatever is in currently and replaces it with a new thing.

any help would be appreciated. thanks

Share this post


Link to post
Share on other sites
One row, or one column? Lists don't belong in single fields.

Share this post


Link to post
Share on other sites
at the moment the field i want my items to go into is as follows,

field name: items
type: longtext
attributes: none
null: no
defaulth: none
extra: none

now, i was told that longtext would work for storing mulitple things in it. now what i want to do is put lets say 10 different things in it and when i echo it echo it as a list. but i dont know if all this is right or even possible and if so what would i need to put to add to the list of things in it?

would it be ADD to players blah='$blah' where user='$user' since i know update resets whatever your updating to its new value

Share this post


Link to post
Share on other sites
It's possible, but not desired -- you should have a separate row for each and every value of the "multiple".

Share this post


Link to post
Share on other sites
[!--quoteo(post=382542:date=Jun 11 2006, 12:20 PM:name=supanoob)--][div class=\'quotetop\']QUOTE(supanoob @ Jun 11 2006, 12:20 PM) [snapback]382542[/snapback][/div][div class=\'quotemain\'][!--quotec--]
yes but then how would i know what row to put each item into?
[/quote]
I don't know what you mean -- if you're adding/deleting a item, you know which row it is; same if you're updating it. Each row would simply have a link back to the base table.

Share this post


Link to post
Share on other sites
[!--quoteo(post=382561:date=Jun 11 2006, 12:38 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 11 2006, 12:38 PM) [snapback]382561[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I don't know what you mean -- if you're adding/deleting a item, you know which row it is; same if you're updating it. Each row would simply have a link back to the base table.
[/quote]


i got that part so what Type of row should it be? test, longtext?

maybe i should explain in a little more detail what i want to happen :S

ok so i want someone to be able to buy a weapon and an armour so they go to the shop. they buy the weapon (1 thing) its gets put into the item row (which at the moment is longtext) then they go to buy the armour and that takes over the weapon. but i dont want it too i want it to store both things in the row. then i want to be able to echo all the things in that row in a list like so.

Weapon
Armour
Weapon
Armour

i will even have 2 rows at one point splittin both things up.

Share this post


Link to post
Share on other sites
That's my point -- you don't want to store them both in one row. You want to store each in its own row, so they won't step one another.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.