Thread: php7
View Single Post
  #3  
Unread 9th January, 2018, 10:08 AM
NightWing NightWing is offline
Dominating
 
Join Date: Jun 2011
Posts: 125
Default

Unfortunately it was not my decision to upgrade to php 7, it was the company which we host our forums from, however theyve always been great with customer support and after a few messages they gave me a way to fix this issue. So for those of u who have this same issue they made this post for us: https://forums.nfoservers.com/viewto...p?f=19&t=14767

---------------------------------------------------------------------------------
In case the link ever goes down, it says:

If you're receiving the following error:


"Uncaught Error: Call to undefined function mysql_connect() in /usr/www/identifier/public/forums/functions/db.php:324"


...this is due to the deprecated mysql extension no longer being included, breaking all "mysql_" functions. Ideally, you would want to switch to one of the newer extensions, like mysqli or PDO, but the old functionality can be corrected with a shim that recreates the functions.

Download the shim here: https://raw.githubusercontent.com/ds.../lib/mysql.php
Upload the mysql.php file to your webhosting. Place it in the includes folder for your website, or a directory where typical config files can be found, if available
Locate a common file that is that is included everywhere in your software. Often this file is called "config.php" or "Settings.php" or similar. Edit that file to add this before other PHP statements:


"include_once('./mysql.php');"

This assumes the shim is in the same directory as the config file. If it's one directory up, you'll use '../mysql.php' and if it's one directory down, you'll use './folder_name/mysql.php'.
If you do not have a common config file, the line above will need to be included in all files using MySQL.
--------------------------------------------------

The link to the shim doesnt actually bring u to a download, u just copy and paste the coding into a blank file and call it "mysql.php"

Last edited by NightWing : 9th January, 2018 at 10:10 AM.
Reply With Quote