I need to change this function
public function getScripts($page, $section){
$data = Yii::app()->db->createCommand()
->select('*')
->from('scripts')
->where("page_id='$page' and section_id='$section'")
->queryAll();
return $data;
}
into a store procedure in MySQL. How would I do this inside Yii for MySQL.
$pageand$sectiondirectly into sql code. Your site will be vulnerable to SQL injections! Use params instead.You can run a stored procedure just like you execute a normal query: