@@ -79,9 +79,10 @@ function syslog_db_fetch_cell($sql, $col_name = '', $log = TRUE) {
7979
8080/* syslog_db_fetch_cell_prepared - run a 'select' sql query and return the first column of the
8181 first row found
82- @param $sql - the sql query to execute
83- @param $col_name - use this column name instead of the first one
84- @param $log - whether to log error messages, defaults to true
82+ @arg $sql - the sql query to execute
83+ @arg $params - an array of parameters
84+ @arg $col_name - use this column name instead of the first one
85+ @arg $log - whether to log error messages, defaults to true
8586 @returns - (bool) the output of the sql query as a single variable */
8687function syslog_db_fetch_cell_prepared ($ sql , $ params = array (), $ col_name = '' , $ log = TRUE ) {
8788 global $ syslog_cnn ;
@@ -97,6 +98,16 @@ function syslog_db_fetch_row($sql, $log = TRUE) {
9798 return db_fetch_row ($ sql , $ log , $ syslog_cnn );
9899}
99100
101+ /* syslog_db_fetch_row_prepared - run a 'select' sql query and return the first row found
102+ @arg $sql - the sql query to execute
103+ @arg $params - an array of parameters
104+ @arg $log - whether to log error messages, defaults to true
105+ @returns - the first row of the result as a hash */
106+ function syslog_db_fetch_row_prepared ($ sql , $ params = array (), $ log = TRUE ) {
107+ global $ syslog_cnn ;
108+ return db_fetch_row_prepared ($ sql , $ params , $ log , $ syslog_cnn );
109+ }
110+
100111/* syslog_db_fetch_assoc - run a 'select' sql query and return all rows found
101112 @arg $sql - the sql query to execute
102113 @arg $log - whether to log error messages, defaults to true
@@ -106,6 +117,16 @@ function syslog_db_fetch_assoc($sql, $log = TRUE) {
106117 return db_fetch_assoc ($ sql , $ log , $ syslog_cnn );
107118}
108119
120+ /* syslog_db_fetch_assoc_prepared - run a 'select' sql query and return all rows found
121+ @arg $sql - the sql query to execute
122+ @arg $params - an array of parameters
123+ @arg $log - whether to log error messages, defaults to true
124+ @returns - the entire result set as a multi-dimensional hash */
125+ function syslog_db_fetch_assoc_prepared ($ sql , $ params = array (), $ log = TRUE ) {
126+ global $ syslog_cnn ;
127+ return db_fetch_assoc ($ sql , $ params , $ log , $ syslog_cnn );
128+ }
129+
109130/* syslog_db_fetch_insert_id - get the last insert_id or auto incriment
110131 @arg $syslog_cnn - the connection object to connect to
111132 @returns - the id of the last auto incriment row that was created */
@@ -135,8 +156,8 @@ function syslog_sql_save($array_items, $table_name, $key_cols = 'id', $autoinc =
135156}
136157
137158/* syslog_db_table_exists - checks whether a table exists
138- @param $table - the name of the table
139- @param $log - whether to log error messages, defaults to true
159+ @arg $table - the name of the table
160+ @arg $log - whether to log error messages, defaults to true
140161 @returns - (bool) the output of the sql query as a single variable */
141162function syslog_db_table_exists ($ table , $ log = true ) {
142163 global $ syslog_cnn ;
0 commit comments