$query = Database::instance('ssd2')->query(Database::SELECT, "SELECT * FROM `mp3s` USE INDEX (artist_2) WHERE `artist` = 'test' AND `id` > 453509 ORDER BY `id` LIMIT 10");
$query->execute();
Fatal error: Call to undefined method Database_MySQLi_Result::execute() in ... line 19
$query->execute();
$artist = 'Аркадий Кобяков';
$id = '453509';
$query = Database::instance('ssd2')->query(Database::SELECT, 'SELECT * FROM `mp3s` USE INDEX (artist_2) WHERE `artist`=:artist AND `id`>:id ORDER BY `id` LIMIT 10')
->parameters(array(
':artist' => $artist,
':id' => $id
));
$query->execute();
Database_Exception [ 1064 ]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':artist AND `id`>:id ORDER BY `id` LIMIT 10' at line 1 [ SELECT * FROM `mp3s` USE INDEX (artist_2) WHERE `artist`=:artist AND `id`>:id ORDER BY `id` LIMIT 10 ]
CREATE TABLE `mp3s` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`artist` varchar(511) COLLATE utf8_unicode_ci NOT NULL,
`aid` int(11) NOT NULL,
`oid` int(11) NOT NULL,
`lid` int(11) NOT NULL,
`song` varchar(511) COLLATE utf8_unicode_ci NOT NULL,
`duration` int(11) NOT NULL,
`show_artist_url` int(11) NOT NULL,
`show_song_url` int(11) NOT NULL,
`url_time` bigint(20) NOT NULL,
`size` int(11) DEFAULT NULL,
`bitrate` int(11) DEFAULT NULL,
`artist_id` int(11) DEFAULT NULL,
`public` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `artist` (`artist`(255),`song`(255)),
KEY `oid` (`oid`,`aid`),
KEY `size` (`size`),
KEY `lid` (`lid`),
KEY `artist_2` (`artist`(255),`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117625329 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
echo "deb http://repo.percona.com/apt xenial main" >> /etc/apt/sources.list
echo "deb-src http://repo.percona.com/apt xenial main" >> /etc/apt/sources.list
CREATE TABLE `finder_humans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lastname_id` int(11) NOT NULL,
`firstname_id` int(11) NOT NULL,
`nickname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`vk_id` bigint(20) DEFAULT NULL,
`bdate` date DEFAULT NULL,
`info` varchar(1023) COLLATE utf8_unicode_ci DEFAULT NULL,
`photo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`city_id` int(11) DEFAULT NULL,
`country_id` int(11) DEFAULT NULL,
`home_town` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`home_phone` varchar(63) COLLATE utf8_unicode_ci DEFAULT NULL,
`skype` varchar(127) COLLATE utf8_unicode_ci DEFAULT NULL,
`facebook` varchar(127) COLLATE utf8_unicode_ci DEFAULT NULL,
`twitter` varchar(127) COLLATE utf8_unicode_ci DEFAULT NULL,
`livejournal` varchar(127) COLLATE utf8_unicode_ci DEFAULT NULL,
`instagram` varchar(127) COLLATE utf8_unicode_ci DEFAULT NULL,
`occupation_type` enum('work','school','university') COLLATE utf8_unicode_ci DEFAULT NULL,
`occupation_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`rate` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `vk_id` (`vk_id`),
KEY `patronymic` (`nickname`),
KEY `birthday` (`bdate`),
KEY `city_id` (`city_id`),
KEY `country_id` (`country_id`),
KEY `firstname_id` (`firstname_id`),
KEY `lastname_id` (`lastname_id`),
KEY `rate` (`rate`),
KEY `lastname_id_2` (`lastname_id`,`firstname_id`,`rate`)
) ENGINE=InnoDB AUTO_INCREMENT=134257090 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci