MysqliDb::insert PHP Method

insert() public method

Insert method to add new row
public insert ( string $tableName, array $insertData ) : boolean
$tableName string The name of the table.
$insertData array Data containing information for inserting into the DB.
return boolean Boolean indicating whether the insert query was completed succesfully.
    public function insert($tableName, $insertData)
    {
        return $this->_buildInsert($tableName, $insertData, 'INSERT');
    }

Usage Example

コード例 #1
2
ファイル: cliente.php プロジェクト: arielcessario/hydrox-V2
function createCupon($cliente_id, $numero)
{
    $db = new MysqliDb();
    $data = array('cliente_id' => $cliente_id, 'numero' => $numero);
    $result = $db->insert('cupones', $data);
    if ($result > -1) {
        echo json_encode(true);
    } else {
        echo json_encode(false);
    }
}
All Usage Examples Of MysqliDb::insert