Method to access the
json_table either creating, getting, updating or inserting a JSON entry. This function will create a JSON entry if it does not exist.
Class: bb_database, called as $main
File: bb_database.php (php)
function process_json($con, $lookup, $arr = array())
$main->process_json($con, $lookup, $arr);
Action: This function has 4 options.
$arris not populated and the JSON entry exists it returns the JSON value in array format
$arris not populated and the JSON entry does NOT exist it creates an entry and returns an empty array
$arris populated and the JSON entry exists it updates the JSON entry
$arris populated and the JSON entry does NOT exist it creates and populates a new JSON entry.
Result: Returns the array supplied if $arr is populated. If not populated, will return the value in the database entry or an empty array.
Note: If you wish to update or get a value only if the value already exists use
$con (database connector)
Valid database connection.
Key used to find JSON row for updating in the database.
Valid PHP array to be converted to JSON and stored in database.