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

update my old php code

Explorer ,
Dec 18, 2020 Dec 18, 2020

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

Views

140

Translate

Translate

Report

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
LEGEND ,
Dec 18, 2020 Dec 18, 2020

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.

Votes

Translate

Translate

Report

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 ,
Dec 18, 2020 Dec 18, 2020

Copy link to clipboard

Copied

LATEST

Manually recode in PHP 7x or get commercial extensions to help you re-build the application from ground up.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

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