Skip to main content
This topic has been closed for replies.
Correct answer Nancy OShea

Yes.  Use the MySQLi (improved) extension to replace the current connection code.

It will look something like this.

<?php require_once('Connections/myConnect_i.php'); ?>

<?php require_once('webassist/mysqli/rsobj.php'); ?>

1 reply

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
April 13, 2018

Yes.  Use the MySQLi (improved) extension to replace the current connection code.

It will look something like this.

<?php require_once('Connections/myConnect_i.php'); ?>

<?php require_once('webassist/mysqli/rsobj.php'); ?>

Nancy O'Shea— Product User & Community Expert
Operacional23
Known Participant
April 28, 2018

Does the site work even with this error?

Operacional23
Known Participant
April 28, 2018

It will not display the   "mysql_pconnect() is deprecated" warnings "  but that's not 100% reliable if your server does not support old MySQL.   Going forward, you must learn to code in PDO or MySQLi.

Below is a script that connects to your database with MySQLi.  Change values in bold as required.

<?php

$con = mysqli_connect("localhost","username","password","database");

// Check connection

if (mysqli_connect_errno())

  {

  echo "Failed to connect to MySQL: " . mysqli_connect_error();

        }

        else echo "Successfully connected, happy coding!"

?>


My connection file looks like this:

<? php

# FileName = "Connection_php_mysql.htm"

# Type = "MYSQL"

# HTTP = "true"

$ hostname_site_d = "localhost";

$ database_site_d = "site_avancado";

$ username_site_d = "root";

$ password_site_d = "";

$ site_d = mysql_pconnect ($ hostname_site_d, $ username_site_d, $ password_site_d) or trigger_error (mysql_error (), E_USER_ERROR);

?>