TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-25-2008, 06:26 AM   #1 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default Adding data - more than one piece in a column?

Hi All

I was just wondering what the best way of doing this would be.

Say I had a database of Actors (each one gets an id as the primary key in the actors table: So would be Actor_id, First Name, Last Name, etc).

Then say I had a page of info (say a movie info page) and I wanted to list the cast on that page. Would I simply have a column called 'actors', then just put the actor_ids in there seperated by commas?

Eg:

Actors: 124,366,697,125,123

But how would I retrieve their names on the page when it is shows to users? I guess I need the select query to know that the comma acts as a marker of sorts?

For a real life example take a look at this page: Play.com (UK) : Spider-Man 1, 2 And 3 (Blu-ray) : Blu-ray - Free Delivery towards the bottom under technical details it lists the actors.

I know it's probably a really simple silly nube question! (Sorry!) Appreciate your help!
__________________
PS3 Forums on GameSlurp - the site for gaming fans!
Brook is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:32 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design