Medoo Database Insertion Issues

Source: Internet
Author: User

Today encountered disease Strider classmate proposed Medoo insert method can not insert database problem, I tested the discovery is possible

and insert INTO "T_user" (username) VALUES (' Test '); This statement is always impossible to execute, and Medoo always helps you to enclose the database's table with double quotes but cannot execute on the command line. And then I couldn't figure out why Medoo could do it, and found a problem.

SET Sql_mode=ansi_quotes is in effect

We inserted the whole insert method and this method is in line 833.

$this,exec$this->table_quote ($tableimplode$columns  implode($values, ', '). ‘)‘);

Method calls the Exec method to execute SQL, while the Exec method in the 183-line core code is

$this->pdo->exec($query);

The core is done by $this->pdo, so how is this thing defined?

Define assignments in 137 rows

The commands variable is required to be executed and originates from

This will set the link to Sql_mode

The command line demo effect is as follows

Medoo Database Insertion Issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.