Nefunguje joinovanie tabuliek v Nette\Database
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- hustleR
- Člen | 8
mam mysql databazu v nej dve tabulky:
CREATE TABLE `nav` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(75) COLLATE utf8_slovak_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovak_ci;
CREATE TABLE `nav_item` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nav_id` int(10) unsigned NOT NULL,
`pos` int(10) unsigned NOT NULL,
`name` varchar(75) COLLATE utf8_slovak_ci NOT NULL,
`uri` varchar(75) COLLATE utf8_slovak_ci NOT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_slovak_ci;
a v nette tento kod:
foreach ($db->table('nav_item')->where('nav.id = ?', 1) as $navItem)
dump($navItem->name);
hadze mi to chybu
„No reference found for $nav_item->nav.
“
viete mi povedat kde ja chyba?