Results 1 to 10 of 10

Thread: Need MySQL Database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187

    Need MySQL Database

    I'm messing with PHP and I need a MySQL database with 5 fields, id, real_name, username, password, and email. How do I go about making one?

    Thanks,

    - Allen
    - Visual Basic 6.0
    - Windows XP Home

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    You mean you need a table with that? Tables hold records. Databases hold tables.

    The easiest way would be to download phpMyAdmin and use it to create your tables.

    Otherwise you'd have to do something like this:

    Code:
    //the below was generated with phpMyAdmin:
    $sql = 'CREATE TABLE `table1` (
        `id` INT( 11 ) NOT NULL AUTO_INCREMENT,
        `real_name` VARCHAR( 50 ) NOT NULL ,
        `username` VARCHAR( 16 ) NOT NULL ,
        `password` VARCHAR( 16 ) NOT NULL ,
        `email` VARCHAR( 255 ) NOT NULL ,
        INDEX ( `id` ) 
    );'
    
    $result = mysql_query($sql) or die(mysql_error());
    
    if ($result) {
        echo "Success!";
    } else {
        echo "Failure...";
    }
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    hmmmm..... Perhaps I mean table... I know absolutely nothing.... I'm trying to follow the instructions on the site below:

    http://www.evilwalrus.com/viewcode/24.php

    Do I need a table or a DB or both ?


    - Allen
    - Visual Basic 6.0
    - Windows XP Home

  4. #4
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    Well, both

    (I havnt read that link, but ...) you'll need to know roughly how to access these commands do you know how to get to the "MySQL Monitor" ?? (its that DOS based, Mysql command console)

    you'rer actually quite better off readinf a bit of the manual (beginners section) before even trying to accomplish this just so you know the basics of making and using a database (before even trying tables).

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    Manual ? There's a manual ?
    - Visual Basic 6.0
    - Windows XP Home

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Member
    Join Date
    Mar 2002
    Posts
    37
    If you're using windows, phpTraid won't be a bad idea, search for it on www.download.com

    www.php.net -- A must.

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by SystemShock
    If you're using windows, phpTraid won't be a bad idea, search for it on www.download.com

    www.php.net -- A must.
    php.net isn't going to do him a lick of good on how to create a database...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    LOL.... when you guys get sorted out what I should do, let me know.

    Hobo, did you look at the site up there ^ to see what I'm trying to copy ?

    - Allen
    - Visual Basic 6.0
    - Windows XP Home

  10. #10
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    You need a mysql server.

    Then you need to create a database under the name of "secretDB"

    You could change the name of the database to another, if you are assigned one by a free provider..

    Basically, you need a mysql server on which you either have root access - to create databases, or where you have access to a current database.

    Then you can connect using the standard php commands ->

    mysql_connect etc

    clearer now?

Posting Permissions

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



Click Here to Expand Forum to Full Width