Jump to content

Archived

This topic is now archived and is closed to further replies.

royax

creating a database

Recommended Posts

Hi there! I'm new to php and mysql. I just downloaded and installed wamp server on my xp! now I want to create a personal website with registration form and log-in. How to create this database in phpmyadmin? and how to connect to the database? i'm kinda new with this stuff! Can somebody help me! If I'm in a wrong place pls help find one!

Share this post


Link to post
Share on other sites
[quote author=royax link=topic=106116.msg424128#msg424128 date=1156871450]
Hi there! I'm new to php and mysql. I just downloaded and installed wamp server on my xp! now I want to create a personal website with registration form and log-in. How to create this database in phpmyadmin? and how to connect to the database? i'm kinda new with this stuff! Can somebody help me! If I'm in a wrong place pls help find one!
[/quote]

i am not sure how you create a database in phpmyadmin, but the general syntax is:

create database database_name;

use database_name;

create table bla(
your_column_titiles
.....
....
..);

To connect to a database using php:
<php?
$mysql_connect = mysql_connect("$hostname", "$username", "$password")
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";

mysql_close($mysql_connect);
?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.