Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

simple php mysql connection code example

Example: php sql connection

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn= mysqli_connect($servername,$username,$password,$dbname);
// Check connection
if (!$conn) {
  die("Connection failed: " . mysqli_connect_error());
}
echo "Connected Successfully.";
?>

Tags:

Php Example

Related

style responsive code example psql: could not connect to server: no such file or directory is the server running locally and accepting connections on unix domain socket "/var/run/postgresql/.s.pgsql.5432"? code example how to create string and inetger in Linked list collection code example turn an array of string numbers to numbers javascript code example make variable needed js code example pop last character in string python code example how to restart nginx linux code example distance between two vectors numpy code example Using custom name for resource routes. code example objects in javascript example save a df as csv code example swal custom css code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy