database in php

lordsofvine

New Member
Messages
41
Reaction score
0
Points
0
can anyone help me how to create database in php and i need the whole steps, thank you so much
 

TheMan177

New Member
Messages
179
Reaction score
0
Points
0
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:
$query = "CREATE DATABASE database_name";
mysql_query($query, $dbconn);

The $dbconn reference is only needed if working with multiple MySQL connections.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
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.
 
Top