PHP $ MYSQL

Programming
Tutor: None Selected Time limit: 1 Day

how to connect database in php

May 10th, 2014

mysqli_connect(host,username,password,dbname);

<?php
// Create connection
$con=mysqli_connect("example.com","peter","abc123","my_db");

// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>

May 10th, 2014

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
May 10th, 2014
...
May 10th, 2014
Feb 23rd, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer