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];
}