<nephtali>

A simple, flexible, fast, and security-focused PHP framework
Nephtali documentation

API documentation

n\sql\action

SQL insert, updaste, and delete functions.

Functions

  • PDO connect(string $dsn, string $username, string $password)

    Creates and returns a connection handle for data actions (i.e., queries that alter rows of the table, such as insert, update, and delete.)

    If no arguments are supplied, the sql_action values in nconfig.php are used to create the connection and the connection is saved for subsequent sql action queries.

  • mixed query(array $query, array $inputs, PDO $dbh, string $last_insert_id_name)

    Performs queries that alter table rows, such as 'INSERT', 'UPDATE', and 'DELETE' queries.

  • bool delete(string $table_name, int $id, PDO $dbh)

    Convenience function for deleting a row from a table by it's id (must follow the convention that the table primary key is named 'id'.)

  • int insert(string $table_name, array $inputs, PDO $dbh, string $last_insert_id_name)

    Convenience function for inserting an associative array row into a table (array keys must match the column names of the table.)

  • mixed save(string $table_name, array $inputs, PDO $dbh, string $last_insert_id_name)

    Convenience function that automatically determines whether to call insert or update.

  • bool update(string $table_name, array $inputs, PDO $dbh)

    Convenience function for updating a table row with values from an associative array (array keys must match the column names of the table.)

Nephtali namespaces