вот есть у меня таблица
Код: Выделить всё
CREATE TABLE `artists` (
`artist_id` smallint(5) unsigned NOT NULL auto_increment,
`artist_name` varchar(255) NOT NULL,
`biography` text,
PRIMARY KEY (`artist_id`),
UNIQUE KEY (`artist_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Код: Выделить всё
public function addArtist($params)
{
$this->setAttributes($params);
return $this->save();
}
Код: Выделить всё
array(2) {
["artist_name"]=>
string(8) "e45tyryh"
["biography"]=>
string(10) "ghyfjghjhj"
}
Код: Выделить всё
public function addArtist($params)
{
$this->setAttributes($params);
$this->artist_name = $params['artist_name'];
$this->biography = $params['biography'];
return $this->save();
}
2) Нужно ли в таком вот способе делать защиту от SQL иньекций, или там в классе уже все сделано?