Using PDO to connect Mysql,sql server2008 or other types of databases, adding and removing changes are these statements MySQL statements?

Source: Internet
Author: User
Rt.
For example, MySQL and window SQL server2008 all have table user1.
I use PDO to connect MySQL and server2008 separately,
$th = new PDO (' ... ', ' root ', ' 123 ');
Is it possible to use $th->prepare (' Inser into User1 values (1, ' name ', ' Joe ') ');

Can you manipulate different types of databases with SQL INSERT statements?

Reply content:

Rt.
For example, MySQL and window SQL server2008 all have table user1.
I use PDO to connect MySQL and server2008 separately,
$th = new PDO (' ... ', ' root ', ' 123 ');
Is it possible to use $th->prepare (' Inser into User1 values (1, ' name ', ' Joe ') ');

Can you manipulate different types of databases with SQL INSERT statements?

Of course not, the specific statement you still need to use the corresponding database of SQL dialect to write (each database of SQL implementation has a certain degree of difference)

No. That's why we like to use frames. Most frameworks will address differences in different databases! Basic write Once. Can be run in a variety of environments. to TP. Laravel. Codeignite will have this ability.

In fact, original aim, not much difference

Adding and deleting changes are basically consistent. Inconsistent is the database attribute.

  • 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.