时间:2021-07-01 10:21:17 帮助过:2人阅读
1.mysql connect
$db=new mysqli (‘localhost‘,‘database‘,‘user‘,‘password‘);
2. query
$query=select id from table_name where name=‘abc‘;
$query=insert into table_name values("id","info");
3.value
$results=$db->query($query);
$num=$results->num_rows;
for($i=0;$i<$num;$i++){
$result_arr=$results->fetch_assoc();
$value1=$result_arr[‘id];
}
mysql php query steps
标签: