我有这张桌子:
CREATE TABLE IF NOT EXISTS `produtos` (
`id` int(11) NOT NULL auto_increment,
`idcatprodutos` int(11) NOT NULL,
`idcategoria` int(11) NOT NULL,
`idmarca` int(11) NOT NULL,
`nome` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_produtos_2` (`idcatprodutos`),
KEY `FK_produtos_3` (`idmarca`),
KEY `FK_produtos_4` (`idcategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=39 ;
Run Code Online (Sandbox Code Playgroud)
和这个表:
CREATE TABLE IF NOT EXISTS `sugestoes` (
`id` int(11) NOT NULL auto_increment,
`idproduto` int(11) NOT NULL,
`idsugestao1` int(11) NOT NULL,
`idsugestao2` int(11) NOT NULL,
`idsugestao3` int(11) NOT NULL,
`idsugestao4` int(11) NOT …Run Code Online (Sandbox Code Playgroud) 在下面的示例中,我收到一个错误,指出$foo->_test由于它是私有的,因此无法访问该值.我究竟做错了什么?
<?php
$foo = new Bar;
$foo->test();
print_r( $foo->_test );
class Foo
{
private $_test = array();
}
class Bar extends Foo
{
public function test()
{
$this->_test = 'opa';
}
}
?>
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏.