
How To Create a Table?

Hi friends,
If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:
<?php
include "mysql_connection_config.php";
$sql = "CREATE TABLE user_info("
. " id INTEGER NOT NULL"
. ", name VARCHAR(80) NOT NULL"
. ", address VARCHAR(1024)"
. ", pin INTEGER". ")";
if (mysql_query($sql, $con)) {
print("Table user_info created.\n");
} else {
print("Table creation failed.\n");
}
mysql_close($con);
?>
Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this: Table user_info created.
Thanks...
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.