C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
PHP MySQL Create TablePHP mysql_query() function is used to create table. Since PHP 5.5, mysql_query() function is deprecated. Now it is recommended to use one of the 2 alternatives.
PHP MySQLi Create Table ExampleExample'; $sql = "create table emp5(id INT AUTO_INCREMENT,name VARCHAR(20) NOT NULL, emp_salary INT NOT NULL,primary key (id))"; if(mysqli_query($conn, $sql)){ echo "Table emp5 created successfully"; }else{ echo "Could not create table: ". mysqli_error($conn); } mysqli_close($conn); ?> Output: Connected successfully Table emp5 created successfully
Next TopicPHP MySQL Insert Record
|