PHP page shows error with the new version of Wampserver64
Posted by: Teixeira (---.virtua.com.br)
Date: March 24, 2020 04:49AM

PHP page shows error with the new version of Wampserver64

Dear,
My problem is no longer importing databases to phpMyAdmin considering the new version of Wampserver64 installed. It has already been resolved.
The problem is that all my PHP pages with a database connection have an error, or better, they don't work.
Example of one of the pages showing an error message.

Notice: Undefined variable: PDO in C: \ wamp64 \ www \ my pages \ versao_03 \ index.php on line 62

Fatal error: Uncaught Error: Call to a member function query () on null in C: \ wamp64 \ www \ my pages \ versao_03 \ index.php on line 62

Error: Call to a member function query () on null in C: \ wamp64 \ www \ my pages \ version_03 \ index.php on line 62


Line 62, in the example code is:
$ result = $ PDO-> query ($ sql);

Please, what do I lose in returning Wampserver to the version it was in? It predates this Wampserver64, but it worked.

This new version touches a lot. Do I have to change the page code in PHP.
The SQL I have in the database that previously worked were tested on phpMyAdmin with the Wampserver64 version and the result was satisfactory. But there is no point working in phpMyAdmin and the pages do not work.
I repeat, I would like to go back to the previous version of Wampserver. Please, what do you think?


Thank you.

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: Otomatic (Moderator)
Date: March 24, 2020 08:55AM

Hi,

These are errors or warnings caused by a newer version of PHP than the one you were using before.

You can install a PHP addon of the version you were using before and then switch to that version.
Under Wampserver, the change of PHP version is done in three clicks :
Left-click -> PHP -> Version -> Choose the desired version.

All available PHP versions are on http://wampserver.aviatechno.net

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29 - MariaDB 10.4.12
Wampserver 3.2.0 64 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29/8.0.19 - MariaDB 10.4.12
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: Teixeira (---.virtua.com.br)
Date: March 24, 2020 12:20PM

Hi,
Thank you very much, for once again give me attention. You are completely right. I already marked Wampserver64, in PHP version 7.1.33 it would have to work normally as it used to.
I have no way of saying that the pages do not work because of this, but "I printei" the screen of phpMyAdmin in the previous version and at the top indicated for "Server: MySQL: 3306", now shows on the same page with the installation of Wampserver64 - " Server: MySQL: 3308 "and MariaDB occupied 3306, as shown at the top of phpMySQL" Server: MariaDB: 3306 ". If I disable MariaDB, the Wampserver64 icon changes color indicating off.
I have always developed my pages with Dreamweaver. Isn't the "Port" used by Dreamweaver to connect to MySQL not 3306 and now he can't find it because it is now 3308?
I'm very sorry for not mastering English. Everything is very complicated for those who don't know.
I am even lost in time, I know that I have been for days and direct, that is, all day reading, reading to solve.
I will continue to follow your guidelines.
There are infinitely worse things in the world right now.
Hug, lots of health and peace. I have faith and trust in you and everything will work out.

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: Teixeira (---.virtua.com.br)
Date: March 24, 2020 01:42PM

**************************************
Yes of course. The connection code I've always used is this:
<? php
// This page is named conexao.php
// ------------------------------------------------ -
// PDO connection model
// PDO is an interface for communicating with
//database. It can be MySQL database,
// PostgreSQL, SQLite and others
// Definition of Beraldo
// ------------------------------------------------ -
define ('MYSQL_HOST', 'localhost');
define ('MYSQL_USER', 'root');
define ('MYSQL_PASSWORD', '');
define ('MYSQL_DB_NAME', 'info16br');

// Connect to the database
try
{
$ PDO = new PDO ('mysql: host ='. MYSQL_HOST. '; Dbname ='.
MYSQL_DB_NAME, MYSQL_USER, MYSQL_PASSWORD);

$ PDO-> exec ("set names utf8"winking smiley;

}
catch (PDOException $ e)
{
'Error connecting to MySQL:'. $ e-> getMessage ();
}
I have a news, please note:

a) I opened phpMyAdmin with the new version Wampserver64;

b) The first page "Welcome to phpMyAdmin" comes as default "root" in the "Server choice:" kept "MariaDB;

c) Opened the second page (now with Server: MariaDB: 3306). I went to the "Database" tab, in the "Create database" field, I typed the name of a database for example "info16br";

d) The "info16br" database was created on the "MariaDB" server;

e) Then I went to the "Import" tab and pointed to my backup folder for the "info16br" file. Ready! Now I have the database with the tables all right;

f) Then I went to dreamweaver, and had my page opened. Ready! Opened the page with the connection to phpMySQL, the records ... everything as before;

I have nothing against MariaDB, but I read very little about MariaDB and everything in English. What a whimper isn't it?
I ask, please, working with MariaDB server is the same as in "SQL server". Just create the normal "SQL query (s)" as you did with an SQL server? Basically what changes in terms of creating the query, View in relation to the SQL server?

Thank you!!!



Edited 1 time(s). Last edit at 03/24/2020 01:50PM by RiggsFolly.

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: RiggsFolly (Moderator)
Date: March 24, 2020 01:49PM

If you dont want to use mariaDB and prefer to use MySQL

Then read ALL of the information that Otomatic gave you on your OTHER QUESTION

And read C:\wamp64\instructions_for_use.pdf
And read C:\wamp64\instructions_for_use.rtf

Oto does his best to communicate with the users, but you do have to look at the information provided

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.0 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 03/24/2020 01:53PM by RiggsFolly.

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: Teixeira (---.virtua.com.br)
Date: March 24, 2020 04:28PM

Dear,
I sincerely thank you for your help with valuable suggestions that have contributed to successful results. I made the inversion of MariaDB <-> MySQL with that it became standard "Server: MySQL: 3306". This guideline when installing Wampserver64, creates the folder wamp64 / mariadb_mysql.txt, where it very clearly guides you how to invert MariaDB to MySQL if you wish.
Everything was back to normal.
Thanks!!!

Options: ReplyQuote
Re: PHP page shows error with the new version of Wampserver64
Posted by: Otomatic (Moderator)
Date: March 24, 2020 05:31PM

Hi,

Why did I decide that starting with Wampserver 3.2.0 MariaDB would be the default database manager and that MySQL would only be installed upon explicit user request?

- MySQL 5.6.47 uses 1.75 GiB of disk space
- MySQL 5.7.29 uses 2.53 GiB of disk space
- MySQL 8.0.19 uses 1.12 GiB of disk space

- MariaDB 10.2.31 uses 350 MiB of disk space
- MariaDB 10.3.22 uses 356 MiB of disk space
- MariaDB 10.4.12 uses 351 MiB of disk space

For the common man, MariaDB can perform the same queries as MySQL and is supported by most CMS such as WordPress, Joomla, PrestaShop, etc.
There are only a few very specialized and geeky operations where MySQL is indispensable.

And I also want to show Wampserver users that they shouldn't be foolish, dumb clicks, for whom everything has to be roasted in their mouths, but on the contrary responsible people who are able to read the documentation.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29 - MariaDB 10.4.12
Wampserver 3.2.0 64 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29/8.0.19 - MariaDB 10.4.12
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.