Copy link to clipboard
Copied
Hello,
I can use this extension:
http://www.webassist.com/dreamweaver-extensions/mysqli
in Adobe Dreamweaver CS6 to cancel this error:
???
Thank you!
1 Correct answer
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'); ?>
Copy link to clipboard
Copied
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'); ?>
Copy link to clipboard
Copied
Does the site work even with this error?
Copy link to clipboard
Copied
Ideally you should change your code. In the meantime you can try adding the following to the top of the page and fingers crossed that the site will still work.
<?php error_reporting( E_ALL ^ E_DEPRECATED ); ?>
Copy link to clipboard
Copied
What does this code mean?
Copy link to clipboard
Copied
It tells your server to report all errors except deprecated error warnings.
Copy link to clipboard
Copied
So it will not display errors?
Copy link to clipboard
Copied
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!"
?>
Copy link to clipboard
Copied
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);
?>
Copy link to clipboard
Copied
MySQL connections are outdated code. You should no longer use them.
Copy link to clipboard
Copied
To make no mistake, just change the connection archiving?
Copy link to clipboard
Copied
Copy & paste this code into a new PHP file and save as test.php
<?php
$con = mysqli_connect("localhost","root","","site_avancado");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else echo "Successfully connected, happy coding!"
?>
Copy link to clipboard
Copied
It worked ...
Copy link to clipboard
Copied
Glad it worked. Now read up on MySQLi (improved).
'MySQLi' for Beginners - Codular
php mysqli tutorial for beginners with example source code
Copy link to clipboard
Copied
If you're still seeing errors, it's because the old MySQL code cannot be mixed with newer MySQLi code.

