I use PDO in my php structure (flight) and I have a funny problem. When I insert 1 row in mysql, I saw 3 rows inserted.
Flight::db()->query("INSERT INTO `menu_item`(`order`, `menu_cat_id`) VALUES (22,1)");
This is all my code:
<?php require 'flight/Flight.php'; Flight::register('db', 'PDO', array('mysql:host=localhost;port=3306;dbname=deliman', 'root', ''), function($db) { $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); $db->exec("SET NAMES 'utf8';"); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0); }); Flight::route('/menu/item/new', function(){
source share