Skip to content

Coding 4 Developers

Running Code Website

  • Home
  • Angular2,4,5,6,7,8
  • Node.js
  • LARAVEL
  • PHP
  • XMPP
  • JAVASCRIPT
  • Contact Us
  • Online Test

Tag: use multiple database connections in php

How to use two database connections in php?

<?php $con1 = mysqli_connect("localhost","root","","db_name1"); $con2 = mysqli_connect("localhost","root","","db_name2"); $emp_db1 = "SELECT emp_id, emp_name FROM employees"; $emp_db1_data = mysqli_query ($con1, $emp_db1); $emp_db2 = "SELECT emp_id, emp_name FROM employees"; $emp_db2_data = mysqli_query ($con2, $emp_db2); ?>

Share This:


June 12, 2016 PHP use multiple database connections in php

Categories

  • Ajax (4)
  • Angular2,4,5,6,7,8 (16)
  • ANGULARJS (4)
  • Facebook API (1)
  • FFMPEG (1)
  • Google Maps API (18)
  • JAVASCRIPT (42)
  • JQUERY (29)
  • LARAVEL (25)
  • Mongo DB (9)
  • MySql (9)
  • MySQL Interview Question & Answers (3)
  • Node.js (17)
  • PHP (45)
  • Python (1)
  • React.js (1)
  • Redis (1)
  • Stripe (2)
  • XMPP (14)
  • ZEND FRAMEWORK (8)

Subscribe to Coding 4 Developers

Follow us on Twitter

Recent Posts

  • How to use Typescript with Node.js | Building a Node.js App with TypeScript
  • Custom Directives in Angular 8 | Angular Directive Tutorial With Example
  • Difference between find() and filter() in JavaScript | ES6 some() and every() functions example
  • MongoDB - Update objects in a document's array | MongoDB update object in Array
  • Angular 8 - Reactive Forms Validation Example | Angular Form Validation Example

Information

  • About Coding 4 Developers
  • Contact Us
  • Privacy Policy

Most Visited Categories

  • Angular2,4,5,6,7,8
  • PHP
  • Node.js
  • LARAVEL
  • XMPP

Recent Posts

  • How to use Typescript with Node.js | Building a Node.js App with TypeScript
  • Custom Directives in Angular 8 | Angular Directive Tutorial With Example
  • Difference between find() and filter() in JavaScript | ES6 some() and every() functions example

Subscribe

Proudly developed by Saurabh