The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding MySQL Tables

Discussion in 'Database Discussions' started by nightone78, Dec 18, 2008.

  1. nightone78

    nightone78 Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Not sure if this the right place to post this....

    I have created a MySQL database to use for a login script that I want to install. I also have a MySQL table, but know where I need to put/save the table so that it works right. Any help would be greatly appreciated.
     
  2. ddeo

    ddeo Active Member

    Joined:
    Sep 4, 2007
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    You should be able to enter your table sytax using MyPHPAdmin, there is a link to this under databases in Cpanel. Hope that helps...
     
  3. yolau

    yolau Active Member

    Joined:
    Sep 1, 2008
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    save your table as txt file.
    Then go to phpMyAdmin --> Import and select your text file to import it into the database.
     
  4. nightone78

    nightone78 Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Alright, thanks much guys
     
  5. nightone78

    nightone78 Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    When I'm uploading, do I need to worry about what the SQL compatibility mode is set to? Or should I just leave it as none?
     
  6. nightone78

    nightone78 Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I tried uploading the following table:

    Code:
    CREATE TABLE  `users` (
     `id` INT( 20 ) NOT NULL AUTO_INCREMENT ,
     `full_name` VARCHAR( 200 ) COLLATE latin1_general_ci NOT NULL DEFAULT  '',
     `user_name` VARCHAR( 200 ) COLLATE latin1_general_ci NOT NULL DEFAULT  '',
     `user_pwd` VARCHAR( 200 ) COLLATE latin1_general_ci NOT NULL DEFAULT  '',
     `user_email` VARCHAR( 200 ) COLLATE latin1_general_ci NOT NULL DEFAULT  '',
     `activation_code` INT( 10 ) NOT NULL DEFAULT  '0',
     `joined` DATE NOT NULL DEFAULT  '0000-00-00',
     `country` VARCHAR( 100 ) COLLATE latin1_general_ci NOT NULL DEFAULT  '',
     `user_activated` INT( 1 ) NOT NULL DEFAULT  '0',
    PRIMARY KEY (  `id` )
    )
    And I returned the following:

    MySQL returned an empty result set (i.e. zero rows)

    So what do I need to do to fix this?
     
  7. sjep

    sjep Member

    Joined:
    Dec 15, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    But you're table is created I guess?

    An empty result set means that there aren't records in the table yet.

    If you would want to import records into that table, you can use for example the following SQL:

    Code:
    INSERT INTO `users` (`id`, `full_name`, `user_name`, `user_pwd`, `user_email`, `activation_code`, `joined`, `country`, `user_activated`) VALUES
    (1, 'full name', 'user name', 'user pwd', 'user email', 123, '2008-12-22', 'France', 1);
     
  8. nightone78

    nightone78 Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Okay, help me out a little here....

    Where would I put the results in the actual code? I've never worked with sql before, and really have no idea what I'm doing....
     
  9. sjep

    sjep Member

    Joined:
    Dec 15, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    lol, you have no idea :)

    Maybe you should tell us what you want to do.
    And then tell us how you would like to do that ...


    Just to have some more information because now I don't understand a lot of what you want
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What does any of this have to do with cPanel?
     
Loading...

Share This Page