@@ -87,41 +87,41 @@ class ezsqlModel extends ezQuery implements ezsqlModelInterface
8787 * Log number of rows the query returned
8888 * @var int Default is null
8989 */
90- protected $ num_rows = null ;
90+ protected $ num_rows = null ;
9191
92- protected $ db_connect_time = 0 ;
93- protected $ sql_log_file = false ;
94- protected $ profile_times = array ();
92+ protected $ db_connect_time = 0 ;
93+ protected $ sql_log_file = false ;
94+ protected $ profile_times = array ();
9595
9696 /**
9797 * ID generated from the AUTO_INCREMENT of the previous INSERT operation (if any)
9898 * @var int
9999 */
100- protected $ insert_id = null ;
100+ protected $ insert_id = null ;
101101
102102 /**
103103 * Use to keep track of the last query for debug..
104104 * @var string
105105 */
106- protected $ last_query = null ;
106+ protected $ last_query = null ;
107107
108108 /**
109109 * Use to keep track of last error
110110 * @var string
111111 */
112- protected $ last_error = null ;
112+ protected $ last_error = null ;
113113
114114 /**
115115 * Saved info on the table column
116116 * @var mixed
117117 */
118- protected $ col_info = array ();
118+ protected $ col_info = array ();
119119
120- protected $ timers = array ();
120+ protected $ timers = array ();
121121 protected $ total_query_time = 0 ;
122- protected $ trace_log = array ();
123- protected $ use_trace_log = false ;
124- protected $ do_profile = false ;
122+ protected $ trace_log = array ();
123+ protected $ use_trace_log = false ;
124+ protected $ do_profile = false ;
125125
126126 /**
127127 * The last query result
@@ -246,7 +246,7 @@ public function flush()
246246 {
247247 // Get rid of these
248248 $ this ->last_result = null ;
249- $ this ->col_info = null ;
249+ $ this ->col_info = array () ;
250250 $ this ->last_query = null ;
251251 $ this ->from_disk_cache = false ;
252252 $ this ->clearPrepare ();
@@ -516,34 +516,34 @@ public function debug($print_to_screen = true)
516516 // Start output buffering
517517 \ob_start ();
518518
519- echo "<blockquote> " ;
519+ echo "\n\n <blockquote> " ;
520520
521521 // Only show ezSQL credits once..
522522 if ( ! $ this ->debug_called ) {
523- echo "<font color=800080 face=arial size=2><b>ezSQL</b> (v " .EZSQL_VERSION .") <b>Debug..</b></font><p> \n " ;
523+ echo "<font color=800080 face=arial size=2><b>ezSQL</b> (v " .EZSQL_VERSION .") \n <b>Debug.. \n </b></font><p> " ;
524524 }
525525
526526 if ( $ this ->last_error ) {
527- echo "<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b> $ this ->last_error </b></font>]<p> " ;
527+ echo "<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b> $ this ->last_error \n </b></font>]<p> " ;
528528 }
529529
530530 if ( $ this ->from_disk_cache ) {
531- echo "<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p> " ;
531+ echo "<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p> \n " ;
532532 }
533533
534- echo "<font face=arial size=2 color=000099><b>Query</b> [ $ this ->num_queries ] <b>--</b> " ;
535- echo "[<font color=000000><b> $ this ->last_query </b></font>]</font><p> " ;
534+ echo "<font face=arial size=2 color=000099><b>Query</b> [ $ this ->num_queries ] \n <b>--</b> " ;
535+ echo "[<font color=000000><b> $ this ->last_query \n </b></font>]</font><p> " ;
536536
537- echo "<font face=arial size=2 color=000099><b>Query Result..</b></font> " ;
538- echo "<blockquote> " ;
537+ echo "<font face=arial size=2 color=000099><b>Query Result..</b></font> \n " ;
538+ echo "<blockquote> \n " ;
539539
540540 if ( $ this ->col_info ) {
541541 // Results top rows
542- echo "<table cellpadding=5 cellspacing=1 bgcolor=555555> " ;
543- echo "<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td> " ;
542+ echo "<table cellpadding=5 cellspacing=1 bgcolor=555555> \n " ;
543+ echo "<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td> \n " ;
544544
545545 for ( $ i =0 , $ j =count ($ this ->col_info ); $ i < $ j ; $ i ++ ) {
546- echo "<td nowrap align=left valign=top><font size=1 color=555599 face=arial> " ;
546+ echo "<td nowrap align=left valign=top><font size=1 color=555599 face=arial> \n " ;
547547 /* when selecting count(*) the maxlengh is not set, size is set instead. */
548548 if (isset ($ this ->col_info [$ i ]->type ))
549549 echo "{$ this ->col_info [$ i ]->type }" ;
@@ -554,36 +554,36 @@ public function debug($print_to_screen = true)
554554 if (isset ($ this ->col_info [$ i ]->max_length ))
555555 echo "{$ this ->col_info [$ i ]->max_length }" ;
556556
557- echo "</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'> " ;
557+ echo "\n </font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'> " ;
558558
559559 if (isset ($ this ->col_info [$ i ]->name ))
560560 echo "{$ this ->col_info [$ i ]->name }" ;
561561
562- echo "</span></td> " ;
562+ echo "\n </span></td> " ;
563563 }
564- echo "</tr> " ;
564+ echo "</tr> \n " ;
565565
566566 // print main results
567567 if ( $ this ->last_result ) {
568568 $ i = 0 ;
569569 foreach ( $ this ->get_results (null , ARRAY_N ) as $ one_row ) {
570570 $ i ++;
571- echo "<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial> $ i</font></td> " ;
571+ echo "<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial> $ i \n </font></td> " ;
572572
573573 foreach ( $ one_row as $ item ) {
574- echo "<td nowrap><font face=arial size=2> $ item</font></td> " ;
574+ echo "<td nowrap><font face=arial size=2> $ item \n </font></td> " ;
575575 }
576- echo "</tr> " ;
576+ echo "</tr> \n " ;
577577 }
578578 } else {
579579 // if last result
580- echo "<tr bgcolor=ffffff><td colspan= " .(\count ($ this ->col_info ) + 1 )."><font face=arial size=2>No Results</font></td></tr> " ;
580+ echo "<tr bgcolor=ffffff><td colspan= " .(\count ($ this ->col_info ) + 1 )."><font face=arial size=2>No Results</font></td></tr> \n " ;
581581 }
582582
583- echo "</table> " ;
583+ echo "</table> \n " ;
584584 } else {
585585 // if col_info
586- echo "<font face=arial size=2>No Results</font> " ;
586+ echo "<font face=arial size=2>No Results \n </font> " ;
587587 }
588588
589589 //echo "</blockquote></blockquote>".$this->donation()."<hr noshade color=dddddd size=1>";
0 commit comments