Chcę pobrać informacje w jednym zapytaniu z 2 tabel, a dokładnie chcę pobrać liczbę rekordów z 2 tabeli na podstawie id z 1 tabeli
zorbiłem coś takiego
$sql = $this->sql->query('select categories.id_categories,category from categories INNER JOIN videos ON categories.categories_id = videos.id_videos');
ale nie chce działać
tabele
CREATE TABLE IF NOT EXISTS `categories` (
`category` text collate utf8_unicode_ci NOT NULL,
`id_categories` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id_categories`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=25 ;
CREATE TABLE IF NOT EXISTS `videos` (
`video` text collate utf8_unicode_ci NOT NULL,
`description` text collate utf8_unicode_ci NOT NULL,
`title` text collate utf8_unicode_ci NOT NULL,
`cover` varchar(50) collate utf8_unicode_ci NOT NULL DEFAULT 'okladki/',
`data` datetime NOT NULL,
`category` int(11) NOT NULL,
`last_viev` datetime NOT NULL,
`views` int(11) NOT NULL,
`videos_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`videos_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;