Paul-D Posted November 24, 2023 Share Posted November 24, 2023 Hi. My host is upgraiding the server from PHP 5.4.45 to PHP 8. I am running Mysql MYSQL 5.5.62. Is this compatable or will I have to work with new drivers. I will be moving from MYSQL 5.5.62 to 5.7.4-43 mysql_query() and mysql_query(). I was told to upgrade this to PDO and have changed my coding to $pdo = connectDB(); $pdo->query(). I have just been told that it is going to be upgraded to MySQLi so my newly created PDO will not work. Will my old mysql_query() still be valid or will I need to do imidate changes. I do not get a say in things like MySQL and PDO. Quote Link to comment https://forums.phpfreaks.com/topic/317474-website-provider-upgrading-php/ Share on other sites More sharing options...
Olumide Posted November 24, 2023 Share Posted November 24, 2023 Moving from PHP 5.4.45 to PHP 8 is a significant version upgrade, and it's good that you are considering updating your code accordingly. Here are some points to consider: 1. mysql_query(): The mysql_ functions, including mysql_query(), have been deprecated and removed in later PHP versions. You should replace them with MySQLi or PDO. 2. PDO: While you've updated your code to use PDO, keep in mind that PDO is a database access layer providing a uniform method of access to multiple databases, including MySQL. It should work fine with MySQL 5.7.4-43. It's important to note that updating to PHP 8 and MySQL 5.7 may introduce other compatibility issues or deprecated features in your code. It's recommended to thoroughly test your application in a development environment before making these changes on your live server. 1 1 Quote Link to comment https://forums.phpfreaks.com/topic/317474-website-provider-upgrading-php/#findComment-1613095 Share on other sites More sharing options...
phpiodore Posted November 26, 2023 Share Posted November 26, 2023 On 11/24/2023 at 6:53 PM, Olumide said: Moving from PHP 5.4.45 to PHP 8 is a significant version upgrade I would even go as far as to say it's impervious to update code cause PHP 5 is quite a bit different from PHP imho Quote Link to comment https://forums.phpfreaks.com/topic/317474-website-provider-upgrading-php/#findComment-1613118 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.