tify"> $ res []=$ a [0];
}
} $ res;
} function get_scalar ($ statement, $ params=array (), $ db_alias= master )
{
$ handle=$ this- gt; execute ($ statement, $ params, $ db_alias); (mysql_numrows ($ handle))
{
$ res=mysql_result ($ handle, 0, 0);
} $ res;
} function get_last_id ($ db_alias= master )
{
$ link=$ this- gt; connect ($ db_alias); mysql_insert_id ($ link);
} function get_affected_rows ($ db_alias= master )
{
$ link=$ this- gt; connect ($ db_alias); mysql_affected_rows ($ link);
}
} sql_statement
{$ db=NULL; $ db_alias= raquo ;; $ db_handle=NULL; $ paramType=NULL; $ statement= raquo ;; $ query= raquo ;; $ params =array (); $ paramsTemp=false; $ paramTypes=array (); $ paramLenghts=array (); $ affectedRows=0; $ rowCount=0; $ _ startTime=0; $ _ endTime=0; $ errorCode=0; $ errorInfo=false; sql_statement ($ db, $ statement, $ db_alias, $ db_handle)
{
$ this- gt; db_alias=$ db_alias;
$ this- gt; db_handle=$ db_handle;
$ this- gt; db=$ db;
$ this- gt; statement=$ statement;
} _ parse_query ()
{
$ this- gt; _cast_values ??();
$ this- gt; query=$ this- gt; statement;
$ i=0;
$ this- gt; query=$ this- gt; statement; (is_array ($ this- gt; paramsTemp))
{($ this- gt; paramsTemp); ($ this- gt; paramsTemp as $ key= gt; $ param)
{
$ this- gt; query=str_replace ($ key, : '. $ i. ' , $ this- gt; query);
$ i ++;
}
$ i=0; ($ this- gt; paramsTemp as $ key= gt; $ param)
{
$ this- gt; query=str_replace (: '. $ i. ' raquo ;, $ this- gt; paramsTemp [$ key], $ this- gt ; query);
$ i ++;
}
} true;
} _ check_param ($ parameter)
{(is_int ($ parameter))
{:: err ( SQL Parse Error. Use only string placeholders . $ this- gt; statement, 3, SQL_ERRORS_FILE); new Exception ( SQL Parse Error. Use only string placeholders );
} ($ parameter [0]!=: || strlen ($ parameter) lt; 2 || $ parameter [1] == ')
{:: err ( SQL Parse Error. Bad placeholder name . $ this- gt; statement, 3, SQL_ERRORS_FILE); new Exception ( SQL Parse Error. Bad placeholder ' s name );
}
} param ($ parameter, amp; $ variable, $ data_type=NULL, $ length=NULL, $ driverOptions=array ())
{
$ this- gt; _check_param ($ parameter);
$ this- gt; param_lengths [$ parameter]=$ length;
$ this- gt; param_types [$ parameter]=$ data_type;
$ this- gt; params [$ parameter]= amp; $ variable;
} bind ($ parameter, $ value, $ data_type=NULL, $ length=NULL, $ driverOptions=array ())
{
$ this- gt; _check_param ($ parameter);
$ this- gt; param_lengths [$ parameter]=$ length;
$ this- gt; param_types [$ parameter]=$ data_type;
$ this- gt; params [$ parameter]=$ value;
} execute ($ input_parameters=NULL)
{(config :: get ( debug_mode ))
{
$ start_time=microtime (true);
} ($ input_parameters! == NULL)
{
$ this- gt; params=$ input_parameters; ($ this- gt; params as $ key= gt; $ value)
{
$ this- gt; _check_param ($ key);
}
}
$ this- gt; _parse_query ();
$ this- gt; _inner_execute (); (config :: get ( debug_mode ))
{
$ span=microtime (true) - $ start_time; :: add ( db raquo ;, array ( query = gt; $ this- gt; query, timespan = gt ; $ span, alias = gt; $ this- gt; db_alias, operation = gt; ));
$ span=sprintf...