Tag Archives: create a table

php create table in working databases

<?php
mysql_connect(“localhost”, “admin”, “password”) or die(mysql_error());
mysql_select_db(“test”) or die(mysql_error());

mysql_query(“create table example(id int not null auto_increment,primary key(id),name varchar(30),age int)”)
or die(mysql_error());

echo “Table Created!”;
?>

Advertisements