Function db_save
Handy db insert/update operation
Package: PHPLucidFrame\Core
Copyright: Copyright (c), PHPLucidFrame.
License: MIT License This source file is subject to the MIT license that is bundled with this source code in the file LICENSE
Author: Sithu sithu@phplucidframe.com
Located at helpers/db_helper.mysqli.php
Copyright: Copyright (c), PHPLucidFrame.
License: MIT License This source file is subject to the MIT license that is bundled with this source code in the file LICENSE
Author: Sithu sithu@phplucidframe.com
Located at helpers/db_helper.mysqli.php
string |
$table |
The table name without prefix |
array |
$data = array() |
<p>The array of data field names and values</p> <pre><code> array( 'fieldNameToSlug' => $valueToSlug, 'fieldName1' => $fieldValue1, 'fieldName2' => $fieldValue2 ) </code></pre> |
integer |
$id = 0 |
The value for ID field to update |
boolean |
$useSlug = true |
<p>TRUE to include the slug field or FALSE to not exclude it The fourth argument can be provided here if you want to omit this.</p> |
array |
$condition = array() |
<p>The condition for the UPDATE query. If you provide this, the first field of <code>$data</code> will not be built for condition</p> <h3>Example</h3> <pre><code>array( 'fieldName1' => $value1, 'fieldName2' => $value2 ) </code></pre> |
boolean|integer|mixed
|
For insert, returns inserted id on success or FALSE on failure; For update, returns updated id on success or FALSE on failure |