<?php
/* codice connessione al server MySQL */
$host = "localhost";
$user = ""; // metti il nome per la connessione al server MySQL
$password = "";
$dbcnx = @mysql_connect("$host", "$user", "$password");
if(!$dbcnx)
{
echo "
Impossibile connettersi al server MySQL" . mysql_error() . "</p>";
exit();
}
$sql_db=mysql_query("CREATE DATABASE lavoro") or die (mysql_error());
$sql_use_db=mysql_query("USE lavoro") or die (mysql_error());
$sql_1 = mysql_query("CREATE TABLE clienti(id int not null auto_increment primary key,
nome text null,
cognome text null,
telefono text null,
email text null,
data date null)
engine=innodb")
or die (mysql_error());
$sql_2 = mysql_query("CREATE TABLE macchina(id int not null auto_increment primary key,
modello text null,
descrizione text null,
data date null)
engine=innodb")
or die (mysql_error());
$sql_3 = mysql_query("CREATE TABLE contratti(id int not null auto_increment primary key,
id_cliente int not null,
id_macchina int not null,
ricavo int,
data date null)
engine=innodb")
or die (mysql_error());
?>