script in database

Discussion in 'Perl' started by E, Apr 16, 2004.

  1. E

    E Guest

    I have two tables and i want join the two of the primary id's in to one
    table. the database is mysql.

    ex.

    Table Item (ID int(10) NOT NULL auto_increment)
    Table Actor(ID int(10) NOT NULL auto_increment)

    to go in to
    Table actor_item(actor_id, item_id)

    so i was wondering the perl script to do that
     
    E, Apr 16, 2004
    #1
    1. Advertising

  2. E

    E Guest

    i didnt give enough info. i have info in a text file and have got perl to
    print it out and now i want to add them to my database.
    my tables look like this
    Item (Id int(10) NOT NULL auto_increment, genre, title, price, quantity,
    descrb, image, length, numdvd, rating, primary key is Id)
    actor ( Id int(10) NOT NULL auto_increment, people_id, chara, primary key is
    Id)
    director (Id int(10) NOT NULL auto_increment, people_id, primary key is Id)

    these represent my items from the text file. I have it to know that $title
    means the tile in my text file.
    $price, $image, $title, $director, $rating, $num_dvds, $length, $genre,
    $$aref[0] (actor), $$aref[1] (character), $stock.


    in the actor_item table: the actor matches up with what movies he is in
    actor_id item_id
    1 1
    1 2 this shows same actor but different
    movie

    so how do i populate the actor_item table?
    ----- Original Message -----
    From: "E" <>
    Newsgroups: comp.lang.perl
    Sent: Thursday, April 15, 2004 11:59 PM
    Subject: script in database


    > I have two tables and i want join the two of the primary id's in to one
    > table. the database is mysql.
    >
    > ex.
    >
    > Table Item (ID int(10) NOT NULL auto_increment)
    > Table Actor(ID int(10) NOT NULL auto_increment)
    >
    > to go in to
    > Table actor_item(actor_id, item_id)
    >
    > so i was wondering the perl script to do that


    "E" <> wrote in message
    news:9SIfc.4746$...
    > I have two tables and i want join the two of the primary id's in to one
    > table. the database is mysql.
    >
    > ex.
    >
    > Table Item (ID int(10) NOT NULL auto_increment)
    > Table Actor(ID int(10) NOT NULL auto_increment)
    >
    > to go in to
    > Table actor_item(actor_id, item_id)
    >
    > so i was wondering the perl script to do that
    >
    >
     
    E, Apr 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,417
    Carl Prothman [MVP]
    Jan 12, 2005
  2. =?Utf-8?B?U1M=?=
    Replies:
    3
    Views:
    3,871
    Juan T. Llibre
    May 15, 2005
  3. Replies:
    8
    Views:
    476
  4. Rajat
    Replies:
    3
    Views:
    730
    Jorgen Grahn
    Jan 8, 2010
  5. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    589
    Jan Kaliszewski
    Jan 7, 2010
Loading...

Share This Page