


PHP 5619 connects to the database. Unable to connect to the database. How to connect to the database. plsql connects to the database.
Jul 29, 2016 am 08:55 AMIt is not recommended to use mysql_connect, mysql_query and other functions in PHP5.3 and above versions. Instead, use the mysqli series (improved). This is an example of connecting to a database and querying data.
<?php require 'conn.php'; //$link=mysqli_connect($host,$user,$pass,$database); $query="select * from user_info"; if($result=mysqli_query($link,$query)){ echo "query was successfully executed.".'<br>'; while($row=mysqli_fetch_assoc($result)){ echo $row["name"]." ".$row["surname"].'<br>'; } mysqli_free_result($result); } else{ echo "the query is not executed.".'<br>'; } mysqli_close($link); ?>
The above introduces PHP 5619 to connect to the database, including the content of connecting to the database. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to deal with SQLException when connecting to database in Java?

How to read the first few records in a database using PHP?

Using Go language to connect to the database: improve application performance and efficiency

How to connect to the database in go language

Steps and techniques for implementing product inventory counting with PHP

Getting Started with Go Language: Basic Concepts of Database Connections

How to install and configure PHP on Ubuntu system to connect to MSSQL database

What are the important functions of MySQL's Jar package?
