Boa tarde pessoal estou tentando fazer uma paginação, esta tudo igual ao video que vi, mas não esta a funcionar, da o seguinte erro.
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /htdocs/public/www/adotados.php on line 133
este é o código:
<?php // Criando conexão $link = mysql_connect('hostingmysql243.amen.pt', 'BD', '123456'); if (!$link) { die('Não foi possÃvel conectar: ' . mysql_error()); } //echo 'Conexão bem sucedida'; $db_selected = mysql_select_db('rebornimaginacoesdebebes_com_pt_bdreborn', $link); $limite = 8; $SQL_COUNT = mysql_query("SELECT COUNT('Registo') from bebes"); $SQL_RESUL = ceil(mysql_result($SQL_COUNT, 0) / $limite); $PG = (ISSET($_GET["pg"])) ? (int)$_GET["pg"] : 1; $inicio = ($pg - 1) * $limite; $sql=mysql_query("SELECT * FROM bebes LIMIT $inicio, $limite ORDER BY Registo asc"); while ($linha = mysql_fetch_array($sql)){ $nome = $linha['Nome']; $foto = $linha['Foto']; echo "<li> <a href='$nome.html' title='$nome'><img src='imagens/miniatura/$foto' width='100' height='80' alt='$nome'></a> </li>";} ?>