diff --git a/assets/php/zpmt-stats-page.php b/assets/php/zpmt-stats-page.php index da96779..a02f54c 100644 --- a/assets/php/zpmt-stats-page.php +++ b/assets/php/zpmt-stats-page.php @@ -46,11 +46,13 @@ class zpmt_stats_page { $this->_npages++; } - $sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' . - $this->_page . ',' . - $this->_npages . ',' . - $this->_offset . ',' . - $this->_limit .')'; +// $sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' . +// $this->_page . ',' . +// $this->_npages . ',' . +// $this->_offset . ',' . +// $this->_limit .')'; + + $sql = $wpdb->prepare('insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,%d,%d,%d,%d);',$this->_page,$this->_npages,$this->_offset,$this->_limit); $wpdb->query($sql); } else { // Load last state @@ -67,7 +69,10 @@ class zpmt_stats_page { if ( $this->_nrows > ($this->_npages*$this->_limit) ) { $this->_npages++; } - $sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1'; + +// $sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1'; + + $sql = $wpdb->prepare('update zgo_pmtlst set pg_npages=%d where pg_ix=1;',$this->_npages); $wpdb->query($sql); } } @@ -149,9 +154,13 @@ class zpmt_stats_page { // // Save new list state // - $sql = 'update zgo_pmtlst set pg_page=' . $this->_page . - ', pg_npages=' . $this->_npages . - ', pg_offset=' . $this->_offset . ' where pg_ix=1;'; + +// $sql = 'update zgo_pmtlst set pg_page=' . $this->_page . +// ', pg_npages=' . $this->_npages . +// ', pg_offset=' . $this->_offset . ' where pg_ix=1;'; + + $sql = $wpdb->prepare('update zgo_pmtlst set pg_page=%d, pg_npages= + %d, pg_offset=%d where pg_ix=1;',$this->_page,$this->_npages,$this->_offset); $wpdb->query($sql); } @@ -233,14 +242,14 @@ class zpmt_stats_page { } $line++; print '