-2

My site http://world2build.hol.es i tried to upgrade mysql to mysqli so i changed all of the mysql_ to mysqli_ but it broke the site

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

-1

With mysqli you have to send the connection with the query. Like this:

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

// Perform queries 
mysqli_query($con,"SELECT * FROM Persons");
mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) 
VALUES ('Glenn','Quagmire',33)");

mysqli_close($con);
?>
Von
  • 1
  • 1