PHP7 not even on MySQL ask for help!!!

Source: Internet
Author: User
Tags stack trace

It is useless to remove the php.ini extension Mysqli.dll and Pdo_mysql.dll front semicolon, MySQL is 5.5

apache2.4 and PHP7 are so well, they can't even get to MySQL.

Fatal error:uncaught error:call to undefined function mysql_connect () in E:\hywebs\test.php:2 Stack trace: #0 {main} thr Own in E:\hywebs\test.php on line2 connection database tip This

This means that the mysql_connect is discarded. You change the PDO.

This means that PHP7 does not support MySQL at the beginning of the method. Lets you learn about the database with two additional mysqli and PDO extension methods. You can get to know about PDO and the like.

My local MySQL service is not open,

7 didn't you say you removed MySQL? It seems that the connection is with mysqli or PDO.

I've been using Sqli.

There is no MySQL extension.

Mysqli Use this.

MySQL has been canceled.

With the PDO connection

1<?PHP2 $pdo=NewPDO (' mysql:host=localhost;dbname=aaa;port=3306 ', ' root ', ' password ');3 $pdo-exec(' Set names UTF8 ');4 5 6 $sql= "INSERT into A1 values (5, ' 123456 ')";7 $res=$pdo-exec($sql);8 Echo' Affects the number of rows: '.$res;9 //$sql = "Delete from A1 where number=5";Ten //$res = $pdo->exec ($sql); One //echo ' affects number of rows: '. $res; A?> -This is PHP7, function to the database AAA A1 Table Insert (5, ' 123456 '); -If you have to create such a table in your database, there are two items in the name.

You are OK, I use PDO even always said can not find the driver, remove php_pdo_mysql things, path set up, Apache also restarted also useless, although MySQL to connect, but PDO alive and well, = =

PHP7 not even on MySQL ask for help!!!

Related Article

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.