SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom fields and mysql

    Hey guys,
    I have this project on hand, where i need to be able to store a dynamic number of fields in my mysql dbase... i need to add a new column for every field... any ideas on the best way to do this?
    Kunal
    i dunno...

  2. #2
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi kunal,

    Whenever you create a new field, you are creating a new column.

    If this isn't what you mean, could you please give some examples?

    -Corbb
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!

  3. #3
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could create a separate table like this:

    CREATE TABLE data (
    rowid INT UNSIGNED NOT NULL,
    type VARCHAR(20),
    value VARCHAR(50)
    );

    where rowid links the row to the other table.
    ck :: bringing chris to the masses.

  4. #4
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whenever you create a new field, you are creating a new column.


    thats what i wanna do but the big problem is, i will need to vary my mysql queries equally...

    i dint understand the new table thing.. how is it gonna help my queries??

    any more ideas??
    i dunno...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •