Minggu, 10 Januari 2010

PHP : MULTI TABEL

$conn=mysql_connect("localhost","","");
$tabel1=coba1;
$tabel2=coba2;

$sql="create table $tabel1 (id int not null primary key, nama varchar(35))";
$qry=mysql_db_query("contoh",$sql,$conn);
if ($qry)
{
print "tabel1 sukses terbentuk
";
}

$sql1="create table $tabel2 (id int not null primary key, nama_mahasiswa varchar(40))";
$qry1=mysql_db_query("contoh",$sql1,$conn);
if ($qry1)
{
print "tabel2 sukses terbentuk";
}

mysql_close();
?>

Tidak ada komentar: