连接MySQL
$connX = new mysqli('127.0.0.1','root','root','数据库名称');
if ($connX->connect_error) {
die("数据库连接失败");
}
查询数据,并处理数据
$sql = 'select jsonArr from recruit where 1=1';
$result = $connX->query($sql);
if(mysqli_num_rows($result) > 0){
while ($row = $result->fetch_assoc()) {
//数据处理逻辑
print($row);
}
}
插入数据
$sql = 'INSERT INTO name (name,sex,...) VALUES';
$result = $connX->query($sql);
最后关闭数据库连接
$connX->close();