Posts marked with "Mysqli" in tags

Connecting database to both mysqli and mysql entension

You can use both mysql and mysqli extension for executing SQL queries. Here is a tutorial on how to connect both the extensions to a database. Create a file named config.php where you will connect to the database. Put the following code in it: localhost", "username", "password", "db"); if ($mysqli-connect_errno) {     echo "Failed to connect to MySQL: (" . $mysqli-connect_errno . ") " . $mysqli-connect_error; } $bd = mysql_connect("localhost", "username", "... [READ MORE]

Check whether mysqli connection is made or not in php

This function helps to check whether connection the mysql server has been made or not. Here is the code: if ($mysqli->ping()) { echo ("Our connection is ok!n"); } else {      printf ("Error: %sn", $mysqli->error); } The $mysqli variable is a connection made via mysqli function. Know more about mysqli ping function here.... [READ MORE]

Subscribe

By subscribing, you agree with Revue’s Terms of Service and Privacy Policy.

Donate

If you found something helpful, please consider a donation to support this site and projects :)

Donate

Subdomains

DemosLab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab