SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do create a new database using phpmysql?

    I have existing database ezbanner.

    How do you create a new database using phpmyadmin?
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, i don't have phpMyAdmin installed anywhere where i have permissions to create a new database, but i can tell ya how to make a script that'll perform that function if you have the authority.
    PHP Code:
    <?php
    //Set some variables for database access:
    $host "localhost"//your host name
    $username "username"// your username
    $pw "password"// your password

    $db_name "newdatabase"// the new db's name

    $db_connect mysql_connect($host$username$pw); // connection stuff

    // if the database is created, print successful, otherwise print that it failed.
    if(mysql_create_db($db_name$db_connect)){
       echo 
    "The new database $db_name, was create sucessfully!";
    } else {
       echo 
    "The new database, $db_name, could not be created!";
    }
    mysql_close($db_connect); // close your db connection
    ?>
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  3. #3
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What authority do you need?
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  4. #4
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also it's on a subdomain.
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  5. #5
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, if this is not your own machine or dedicated webserver, then chances are, your not allowed to create a database.
    I don't know of any hosts that allow free creation of databases on their sites.
    Contact your admin or help desk and ask them if they can create another database for you.
    Unless you have a really good reason for needing a second one, i doubt the will though.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  6. #6
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Defender1.

    It's for my site, but actually for my client's site which hosted in some shared host. They don't allow any SSH or Telnet either, othersiwe it will ease m work.
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  7. #7
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your best bet if your designing for clients, is to get yourself a dedicated server. then you'd have absolute control over that kinda stuff.
    though unless your doing good business, they can be pretty pricy.
    if you do invest in one, try re-selling.
    Sell off some hosting for like, $10-15/month for a couple hundred megs of space with all the trimmings.
    that'll ease the cost of a wonderful thing.
    (One of my sites is hosted on my friends dedi - 1 gig of space with all the trimmings for $20/month. )
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  8. #8
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm currently designing the back end only since they already host with someone else. I have 2 dedicated server currently which is for my own use.

    Probably I should resell some space.
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  9. #9
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, if you own the server then copy that code to a php script and run it. it'll spit back an error if you can't create on, or it'll create it
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  10. #10
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Defender1
    I don't know of any hosts that allow free creation of databases on their sites.
    Unless you have a really good reason for needing a second one, i doubt the will though.
    Actually most good hosts use CPANEL or some type of end-user control panel software that allows users to do many tasks themselves, including create email accounts and databases. Assuming your account allows more than one, it would be a simple matter of clicking around the control panel for your site.
    Kevin

  11. #11
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea, i've used CPANEL and some a couple other kinds.
    but with all of them, i don't have the power to create databases on will.
    i get one per domain.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  12. #12
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've heard lots of good things about CPanel, but currently I'm using Plesk.
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  13. #13
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea, my newest host (www.featureprice.com - not the fastest speeds, but everything else is superb) uses plesk.
    i liked cpanel better
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •