Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old September 21st, 2003, 08:32 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Arrays and Mysql?

I am confused. When you fetch data from MySql is comes back as an array but i want to store mutiple fields as a array in a single mysql field. is this possibel What i am doing is making a shopping system and i don't want to have a seperate mysql fields for each item I want to store the whole cart contents in one mysql field. I hope I was clear Thank you in advance

-Hap Hayes

Reply With Quote
  #2  
Old September 21st, 2003, 09:07 PM
kleigh kleigh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Illinios USA! USA!
Posts: 10 kleigh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Arrays and Mysql?

I suppose you could, it would be a single long string. Not only would this be grossly ineffcient, but this violates 1st Normal Form. http://databases.about.com/library/weekly/aa081901a.htm

Why do you want to combine all that info into a single field anyways?

Reply With Quote
  #3  
Old September 22nd, 2003, 11:15 AM
nazly nazly is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Colombo,SriLanka
Posts: 1,325 nazly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 18 sec
Reputation Power: 3
Send a message via Yahoo to nazly
RE: Arrays and Mysql?

I understand your point but consider on what kleigh has stated..
Yu can store the item ids in a string seperated by a delimeter.. eg: IT004|IT220|IT250
Also there is a data type in MySQL to do this kinda thing called SET..
You can follow this link for more on it..
http://www.mysql.com/doc/en/SET.html

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Arrays and Mysql?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT