Ehm... nu kanske detta är fel ställe i forumet för detta men hur ser detta ut?
<?php
// -=INSERT RIGHT INFO HERE=-
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Create database
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Cpu
(
Tillverkare varchar(25),
Socket varchar(25),
Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Gpu
(
Gpu Tillverkare varchar(25),
Gpu Formfaktor varchar(25),
Gpu Socket varchar(25),
Gpu Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Mobo
(
Cpu Tillverkare varchar(25),
Gpu Tillverkare varchar(25),
Gpu Form varchar(25),
Ram Form varchar(25),
Ram Typ varchar(25),
Chassi Formfaktor varchar(25),
Socket varchar(25),
Max Ram int,
Ram Hastighet(MHz) int,
Antal Portar int,
Hdd Formfaktor varchar(25),
Cd Formfaktor varchar(25),
Hdd Rpm int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Chassi
(
Chassi Formfaktor varchar(25)
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Hdd
(
Hdd Formfaktor varchar(25),
Hdd Power(MHz) int,
Hdd rpm int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Cd
(
Cd Formfaktor varchar(25),
Cd Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Audio
(
Audio Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Natagg
(
Max Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE kylning
(
Cpu Tillverkare varchar(25),
Cpu Socket varchar(25),
Cpu Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Floppy
(
Floppy Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Ram
(
Typ varchar(25),
Formfaktor varchar(25),
Storlek int,
Socket varchar(10),
Hastighet int,
Ram Power(MHz) int
)";
// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Ovrigt
(
Ovrigt Power(MHz) int
)";
// Execute query
mysql_query($sql,$con);
mysql_close($con);
?>