supanoob Posted June 10, 2006 Share Posted June 10, 2006 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted June 10, 2006 Share Posted June 10, 2006 One row, or one column? Lists don't belong in single fields. Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 10, 2006 Author Share Posted June 10, 2006 at the moment the field i want my items to go into is as follows,field name: itemstype: longtextattributes: nonenull: nodefaulth: noneextra: nonenow, 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted June 11, 2006 Share Posted June 11, 2006 It's possible, but not desired -- you should have a separate row for each and every value of the "multiple". Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 11, 2006 Author Share Posted June 11, 2006 yes but then how would i know what row to put each item into? Quote Link to comment Share on other sites More sharing options...
fenway Posted June 11, 2006 Share Posted June 11, 2006 [!--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. Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 11, 2006 Author Share Posted June 11, 2006 [!--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 :Sok 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.WeaponArmourWeaponArmouri will even have 2 rows at one point splittin both things up. Quote Link to comment Share on other sites More sharing options...
fenway Posted June 12, 2006 Share Posted June 12, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.