SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    insert multiple values into one column only

    Hi
    I have one table with five fields and one of them is keywords which is VARCHAR(255).
    TABLE STRUCTURE IS
    Code:
    CREATE TABLE `table` (
      `id` int(6) NOT NULL auto_increment,
      `value` varchar(250) NOT NULL default '',
      `title` varchar(250) NOT NULL default '',
      `url` varchar(250) NOT NULL default '',
      `keywords` varchar(250) NOT NULL default '',
       PRIMARY KEY  (`id`)
    )  ENGINE=MyISAM DEFAULT CHARACTER SET cp1250 COLLATE=cp1250_croatian_ci;

    INSERT INTO `table` VALUES (1, 'value1','value2','value3','value4');

    Now, how can I insert multiple values into keywords column only ?

    Regards,

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    INSERT INTO table VALUES (1, 'value1', 'value2', 'value3', 'keyword1, keyword2, keyword3, keyword4');

    ?

    Or you could normalize this database and store keywords, one row per keyword, in another table.

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,194
    Mentioned
    17 Post(s)
    Tagged
    5 Thread(s)

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, thanks


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
  •