<?php
include_once("./api/Database.php");
$connection = Database::dbConnection
(
"127.0.0.1",
"username",
"password",
"schema_name"
);
$table = "user_ip_addr";
$columnList =
array(
array('column'=>"ip_addr"),
array('name'=>"new", 'column'=>'ip_addr', 'calc'=>"MAX")
);
$conditionList =
array(
array('column'=>"id", 'operator'=>" > ", 'value'=>"999", 'linking'=>""),
array('value'=>"1", 'linking'=>"AND")
);
$groupList = array('ip_addr');
$orderList = array('ip_addr');
$limit =
array(
array('min'=>"1", 'max'=>"100")
);
Database::selectData($connection, $table, $columnList, $conditionList, $groupList, $orderList, $limit);
$columnList = null;
$dataList =
array(
"null", "192.168.0.1", "0"
);
Database::insertData($connection, $table, $columnList, $dataList);
$id = Database::mysql_insert_id($connection);
$columnList = array("status");
$dataList = array("1");
$conditionList =
array(
array('column'=>"id", 'operator'=>"=", 'value'=>$id, 'linking'=>"")
);
Database::updateData($connection, $table, $columnList, $dataList, $conditionList, $limit);
$limit = "1";
Database::deleteData($connection, $table, $conditionList, $limit);
?>
|