赣南脐橙

keybr

佰草伐

导航

PHP MySQLi创建表示例

<?php  
$host = 'localhost:3306';  
$user = 'root';  // MySQL用户账号
$pass = '';  
$dbname = 'test';  

$conn = mysqli_connect($host, $user, $pass,$dbname);  
if(!$conn){  
  die('Could not connect: '.mysqli_connect_error());  
}  
echo 'Connected successfully<br/>';  

$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);  
?>

  直线电机滑台

posted on 2020-07-15 14:37  佰草伐  阅读(202)  评论(0编辑  收藏  举报

keybr

php基础知识

Wood Furniture