I'm having a little problem in this IPS forum news system, it works perfectly in PHP 5.x, however I upgraded PHP to 7.1 is experiencing this error ( this system separates categories from the forum to show on the website )
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\forum\connect.php:18 Stack trace: #0 C:\xampp\htdocs\forum\news.php(5): mysql->__construct() #1 {main} thrown in C:\xampp\htdocs\forum\connect.php on line 18
file connect.php
<?php
error_reporting(0);# remove syntax errors (VertrigoServ / XAMP and others)
DEFINE('HOST','localhost');# Padrão
DEFINE('USER','ragnarok');# Usuário do pma
DEFINE('PASS','ragnarok');# Senha do pma
DEFINE('DATABASE','forum');# Nome da database do fórum
DEFINE('BOARD','localhost/forum/');# link do seu fórum
DEFINE('LIMIT','5');# Limite de Notícias que será exibida
DEFINE('CATEGORY1','4');# ID da categoria dos Changelog (coluna forum_id = %)
DEFINE('CATEGORY2','2');# ID da categoria das Notícias da Staff (coluna forum_id = %)
DEFINE('CATEGORY3','5');# ID da categoria dos Eventos (coluna forum_id = %)class mysql
{publicfunction __construct(){
$this->conn = mysql_connect( HOST, USER, PASS )ordie( mysql_error());
$this->select= mysql_select_db( DATABASE, $this->conn )ordie( mysql_error());}publicfunction build( $query ){
$this->query = $query;}publicfunction execute(){
$this->query = mysql_query( $this->query )ordie( mysql_error());}publicfunction numrows(){return mysql_num_rows( $this->query );}publicfunction fetchassoc(){return mysql_fetch_assoc( $this->query );}}?>
Question
Haikenz
I'm having a little problem in this IPS forum news system, it works perfectly in PHP 5.x, however I upgraded PHP to 7.1 is experiencing this error ( this system separates categories from the forum to show on the website )
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\forum\connect.php:18 Stack trace: #0 C:\xampp\htdocs\forum\news.php(5): mysql->__construct() #1 {main} thrown in C:\xampp\htdocs\forum\connect.php on line 18
file connect.php
file news.php
Link to comment
Share on other sites
5 answers to this question
Recommended Posts