Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adobe Dreamweaver CS6 - MySQLi Server Behaviors

Explorer ,
Apr 13, 2018 Apr 13, 2018

Hello,

I can use this extension:

http://www.webassist.com/dreamweaver-extensions/mysqli

in Adobe Dreamweaver CS6 to cancel this error:

01.png

???

Thank you!

TOPICS
How to
9.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 13, 2018 Apr 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'); ?>

Translate
Community Expert ,
Apr 13, 2018 Apr 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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 27, 2018 Apr 27, 2018

Does the site work even with this error?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2018 Apr 27, 2018

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 ); ?>
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2018 Apr 28, 2018

What does this code mean?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 28, 2018

It tells your server to report all errors except deprecated error warnings.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2018 Apr 28, 2018

So it will not display errors?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 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!"

?>

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2018 Apr 28, 2018

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);

?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 28, 2018

MySQL connections are outdated code.   You should no longer use them.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2018 Apr 28, 2018

To make no mistake, just change the connection archiving?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 28, 2018

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!"

?>

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2018 Apr 28, 2018

It worked ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 28, 2018

Glad it worked.  Now read up on MySQLi (improved).

'MySQLi' for Beginners - Codular

php mysqli tutorial for beginners with example source code

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2018 Apr 28, 2018
LATEST

If you're still seeing errors, it's because the old MySQL code cannot be mixed with newer MySQLi code.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines