Permalink
Browse files

Update ydb->get_results()

[skip ci]
  • Loading branch information...
ozh committed Sep 1, 2017
1 parent 97c8177 commit fad0de35d4f571724b79cde4a32c998d45b5c932
Showing with 75 additions and 69 deletions.
  1. +2 −2 includes/functions-upgrade.php
  2. +1 −1 includes/functions.php
  3. +72 −66 yourls-infos.php
@@ -87,7 +87,7 @@ function yourls_upgrade_to_143( ) {
global $ydb;
$table_log = YOURLS_DB_TABLE_LOG;
$sql = "SHOW COLUMNS FROM `$table_log`";
$cols = $ydb->get_results( $sql );
$cols = $ydb->fetchObjects( $sql );
if ( $cols[2]->Field == 'keyword' ) {
$sql = "ALTER TABLE `$table_log` CHANGE `keyword` `shorturl` VARCHAR( 200 ) BINARY;";
$ydb->query( $sql );
@@ -278,7 +278,7 @@ function yourls_update_table_to_14() {
$sql = "SELECT `keyword`,`url` FROM `$table` WHERE 1=1 ORDER BY `url` ASC LIMIT $from, $chunk ;";
$rows = $ydb->get_results($sql);
$rows = $ydb->fetchObjects($sql);
$count = 0;
$queries = 0;
View
@@ -583,7 +583,7 @@ function yourls_get_stats( $filter = 'top', $limit = 10, $start = 0 ) {
if ( $limit > 0 ) {
$table_url = YOURLS_DB_TABLE_URL;
$results = $ydb->get_results( "SELECT * FROM `$table_url` WHERE 1=1 ORDER BY `$sort_by` $sort_order LIMIT $start, $limit;" );
$results = $ydb->fetchObjects( "SELECT * FROM `$table_url` WHERE 1=1 ORDER BY `$sort_by` $sort_order LIMIT $start, $limit;" );
$return = array();
$i = 1;
Oops, something went wrong.

0 comments on commit fad0de3

Please sign in to comment.