Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create mysql table
12-04-2013, 09:03 AM,
Post: #1
create mysql table
<?php
// Create a MySQL table in the selected database
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!";
?>
Reply
[-] The following 3 users Like josephyala's post:
  • Ravisain, the, zigzag-nazmul
11-25-2014, 10:50 AM, (This post was last modified: 11-25-2014, 10:53 AM by matrimony.)
Post: #2
RE: create mysql table
tamil matrimonial

Hi guys,The CREATE TABLE statement is used to create a table in a database.
SQL CREATE TABLE Syntax
CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....
);
The column_name parameters specify the names of the columns of the table.
The data_type parameter specifies what type of data the column can hold (e.g. varchar, integer, decimal, date, etc.).
The size parameter specifies the maximum length of the column of the table.
Example
CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);

Thank youWink
Reply
02-08-2015, 07:31 AM,
Post: #3
RE: create mysql table
mysql_query() is depreciated. Use mysqli_query
Reply
[-] The following 1 user Likes bearnithi's post:
  • Ugurxl
04-16-2016, 11:25 AM,
Post: #4
RE: create mysql table
how can I backup my phpMyAdmin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)