January 31, 2012, 9:14pm
I want to do multi queries like
$sql = 'InsERT INTO table (…);
INSERT INTO table (…);
INSERT INTO table (…);’;
but what Yii function can I use to escape the user input going into the mysql queries?
what Yii function can I use for multiple queries at once?
February 1, 2012, 4:47am
This should do it.
February 4, 2012, 10:23pm
When I use that, it puts unnecessary quotation marks around the input… LIke Jane because ‘Jane’ and when I save again it becomes ‘‘Jane’’
February 5, 2012, 4:22am
As I know, you cannot do that with Yii becuase Yii use PDO which does not let you to perform multi-queries in one command. You may have to get the connectionString and other connection info from Yii::app()->db to create a pure PHP-MySQl connection and run mysql_query().
April 18, 2014, 10:27am
mysql_query cannot execute multiple records,- it’ll give you an error. Use mysqli.multi-query instead.