"https://dedikit.net/api", "id" => $DB_ID, "password" => $DB_PASSWORD )); if($dedikit_ERROR) { print "LOGIN ERROR: $dedikit_ERROR\n"; exit(1); } $TEST_IP = "1.2.3.4"; // inserting ip address $TEST_IP dedikit_insert(array( "table" => "ip_pool", "columns" => array( "ipaddr" => $TEST_IP, ), )); if($dedikit_ERROR) { print "INSERT ERROR: $dedikit_ERROR\n"; exit(1); } // get ID of inserted IP $arr = dedikit_select(array( "table" => "ip_pool", "columns" => array("id", "ipaddr"), "where" => array( array( "op" => "EQ", "name" => "ipaddr", "value" => $TEST_IP, ), ), )); if($dedikit_ERROR) { print "SELECT ERROR: $dedikit_ERROR\n"; exit(1); } // since ip_pool.ipaddr unique we getting only one array element $got_id = $arr[0]['id']; if(!$got_id) { print "Unexpected error!\n"; exit(1); } // modifying record dedikit_update(array( "table" => "ip_pool", "columns" => array( "comment" => "new comment", ), "where" => array( array( "op" => "EQ", "name" => "id", "value" => $got_id, ), ), )); if($dedikit_ERROR) { print "UPDATE ERROR: $dedikit_ERROR\n"; exit(1); } // deleting record dedikit_delete(array( "table" => "ip_pool", "where" => array( array( "op" => "EQ", "name" => "id", "value" => $got_id, ), ), )); if($dedikit_ERROR) { print "DELETE ERROR: $dedikit_ERROR\n"; exit(1); } ?>