Helper: dbquery: Unterschied zwischen den Versionen

Aus CodeCoupler Wiki
Zur Navigation springen Zur Suche springen
Tm (Diskussion | Beiträge)
Die Seite wurde neu angelegt: „This helper provides only one function: <code> function dbquery($sql) </code> The function executes the database query. If an error occurs the function will …“
 
Tm (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
This helper provides only one function:
This helper provides only one function:


<code>
<syntaxhighlight lang="php">
function dbquery($sql)
function dbquery($sql)
</code>
</syntaxhighlight>


The function executes the database query. If an error occurs the function will throw an exception. If the query success the return value depends on the type of query.
The function executes the database query. If an error occurs the function will throw an exception. If the query success the return value depends on the type of query.

Version vom 16. August 2012, 15:57 Uhr

This helper provides only one function:

function dbquery($sql)

The function executes the database query. If an error occurs the function will throw an exception. If the query success the return value depends on the type of query.

  • SELECT-Statements return the codeigniter result-object
  • INSERT-Statements return the last inserted id
  • UPDATE or DELETE (and all the other) Statements return the number of rows affected