Copy link to clipboard
Copied
Hello,
I have an old site build on PHP 5.6 I Want to upgrade to a new server with php 7
I it enough to change the connection code?
This is my cnnection code
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Mastercar = "**";
$database_Mastercar = "**";
$username_Mastercar = "**";
$password_Mastercar = "**";
$Mastercar = mysql_pconnect($hostname_Mastercar, $username_Mastercar, $password_Mastercar) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Thank in advance
Copy link to clipboard
Copied
NO, its NOT enough just to change the database connection code, you have to change the queries to the database as well. I'd stick to 5.6 for now, unless you want to undertake a complete connection/querying rewrite.
No website being created today should use mysql instead use either mysqli(improved) or PDO. Old websites which use mysql, which is NOT compatible with php versions 5.6+ the connection and querying needs to be completely revised or kept on life support until the time comes to update.
Copy link to clipboard
Copied
Manually recode in PHP 7x or get commercial extensions to help you re-build the application from ground up.