mysql操作方法

<?php
 
$conn=new MySQLi("db_host","db_username","db_password");
 
$conn->select_db("db_name");
 
//查询
 
$sql="select * from table_name";
 
//添加
 
$sql='insert into table_name(column1,column2) values("value1","value2")';
 
//修改
 
$sql='update table_name set column1="value1" , column2="value2" where column0="value0"';
 
//删除
 
$sql='delete from table_name where column0="value0"';
 
$conn->query($sql);
 
?>