noneDB is FREE and OPEN SOURCE noSQL database for PHP projects. No any installations!, Just include and GO. Fast, Stable, Secure, Awesome for small projects.
noneDB is free and open source noSQL database for php projects. No any installations!, Just include and GO.
extra features:
Please change the value on this variables! and don’t share! (noneDB.php)
private $dbDir="db/"; // please change this path and don't fotget end with /
private $secretKey="nonedb_123"; // please change this secret key! and don't share anyone or anywhere!!
private $autoCreateDB=true; // if you want to auto create your db true or false
<?php
include("noneDB.php");
$noneDB = new noneDB;
$data = array("username"=>"orhanayd", "password"=>"123456");
/**
* $data will be insert to your_dbname
*/
$insert = $noneDB -> insert("your_dbname", $data);
echo json_encode($insert);
?>
Response:
{
"n": 1
}
<?php
include("noneDB.php");
$noneDB = new noneDB;
$data = array(
array("username"=>"orhanayd", "password"=>"123456"),
array("username"=>"kemalataturk", "password"=>"1234567");
);
/**
* $data will be insert to your_dbname
*/
$insert = $noneDB -> insert("your_dbname", $data);
echo json_encode($insert);
?>
Response:
{
"n": 2
}
(Like “SELECT” query in sql)
<?php
include("noneDB.php");
$noneDB = new noneDB();
/**
* you can find like this;
* array("username"=>"orhan")
* or
* array("key"=>[2,4,5])
* returns only 0,2,3 keys
*/
$filter = array("username"=>"orhanayd");
$test = $noneDB -> find("your_dbname", $filter, false);
echo json_encode($test);
?>
Result:
[
{
"username": "orhanayd",
"password": "123456",
"key": 0
}
]
<?php
include("noneDB.php");
$noneDB = new noneDB();
/**
* array(
* array of one => search criteria
* array("set"=> new values or new keys)
* )
*
* note: you can update by key for example;
* array(
* array("key"=>[0,2,3]),
* array("set"=>array("newkey"=>"newvalue", "oldkey"=>"newvalue"))
* )
* it will only update keys 0,2,3.
*
*/
$update = array(
array("username"=>"orhanayd"),
array("set"=>array(
"password"=>"123456789"
))
);
$test = $noneDB -> update("your_dbname", $update);
echo json_encode($test);
?>
Result:
{
"n": 1
}
<?php
include("noneDB.php");
$noneDB = new noneDB();
/**
* you can delete like this;
* array("username"=>"orhanayd")
* or
* array("key"=>[2,4,5])
* just delete only 0.2,3 keys
*/
$filter = array("username"=>"orhanayd");
$test = $noneDB -> delete("your_dbname", $filter);
echo json_encode($test);
?>
Result:
{
"n": 1
}
for example:
<?php
include("noneDB.php");
$noneDB = new noneDB();
$filter = array("username"=>"orhanayd");
$test = $noneDB -> find("your_dbname", $filter, false);
/**
* $test is result array
* 10 is how much limit for result
*/
$test = $noneDB -> limit($test, 10); // Limit
/**
* will returns only 10 array.
*/
echo json_encode($test);
?>
MIT
Free Software, Hell Yeah!