Re: Deprecated features in php 7.1

From: Date: Thu, 23 Feb 2017 15:51:27 +0000
Subject: Re: Deprecated features in php 7.1
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-325988@lists.php.net to get a copy of this message
On 23 February 2017 15:11:57 GMT+00:00, Release Edl <release_editorial@terra.com.br> wrote: >The script bellow is working properly under php 5.6, but not in php >7.1. >What could we do to fix it? > ><?php > >include("_restrito/conexao.php"); > > $conexao = mysql_connect($host,$user,$pass,$db); > > if(!$conexao) > > die("Nao foi possivel conectar no servidor MySQL. Erro: " . >mysql_error()); > > mysql_select_db($db) or die("Nao foi possivel usar o banco de dados. >Erro: " . mysql_error()); > > $pagina = $_GET['pagina']; > > $banco = mysql_select_db("mensagem"); > > $busca = "SELECT * FROM portfolio ORDER BY id DESC"; > > $total_reg = "5"; > if (!$pagina) { > $pc = "1"; >} else { > $pc = $pagina; >} > >$inicio = $pc - 1; >$inicio = $inicio * $total_reg; > >$limite = mysql_query("$busca LIMIT $inicio,$total_reg"); >$todos = mysql_query("$busca"); > >$tr = mysql_num_rows($todos); >$tp = $tr / $total_reg; >while ($dados = mysql_fetch_array($limite)) { > >?> > >Thanks in advance for any help. >Att., >Paulo You shouldn't be using the mysql_* functions, and they've been deprecated for years. I'd recommend using PDO instead. Thanks, Ash

« previous php.general (#325988) next »