+ Reply to Thread
Results 1 to 3 of 3

Thread: database in php

  1. #1
    lordsofvine is offline x10Hosting Member lordsofvine is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    41

    database in php

    can anyone help me how to create database in php and i need the whole steps, thank you so much

  2. #2
    TheMan177 is offline x10 Sophmore TheMan177 is an unknown quantity at this point
    Join Date
    Jan 2008
    Posts
    179

    Re: database in php

    Assuming you already have an open connection to MySQL, you can store a query in a variable and use PHP's mysql_query function to run it.

    PHP Code:
    $query "CREATE DATABASE database_name";
    mysql_query($query$dbconn); 
    The $dbconn reference is only needed if working with multiple MySQL connections.

  3. #3
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: database in php

    OK - I find using mysql query systems a little cumbersome and too syntax dependant.

    Simple steps

    1) go to your cpanel (link provided in your first setup e-mail from x10)
    2) about half way down, there is a section for databases - click on MySQL wizard.

    The wizard will take you through the simple steps to create your database. Don't forget, you need to set up a new username and password for your database, which will be used for your connection strings in php.

    You also need to set user priviledges for your database - even though you set it up!

    Lastly, I would use phpmyadmin - a simple to use interface for controlling your database structure and stored data.

    Within your first Database, you need to define tables.

    Create a new new table and set how many fields you want it to have.

    Define the fields.

    After you've set up your first usable database, you then need to set up your connection script in php which will access the database.

    Using something like Dreamweaver (which I use) makes this really simple.

    Hope this hlps a bit.

+ Reply to Thread

Similar Threads

  1. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  2. php & database help
    By playdnd in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 12-05-2007, 10:55 PM
  3. Cambios IMPORTANTES en PHP.
    By Fedlerner in forum Noticias y Anuncios
    Replies: 1
    Last Post: 11-06-2007, 11:13 AM
  4. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  5. search database with php
    By niahossain in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 10-17-2007, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers