Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Ola galera to precisando de uma ajuda, meu ta dando o seguinte erro!
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\seo\url\categoria.php on line 4
index.php
<?php include"config.php";
$conecta = mysql_connect($servidor, $usuario, $senha);
$selDb = mysql_select_db($db);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Url's Amigáveis</title>
</head>
<body>
<?php include_once("menu.php");?>
<?php
$url = $_GET['url'];
$urlE = explode('/', $url);
$arquivo = $urlE['0'];
$post = $urlE['1'];
$paginas = array('empresa', 'contato');
if(isset($post) && $post != ''){
include "single.php";
}elseif(isset($arquivo) && in_array($arquivo, $paginas)){
include "$arquivo.php";
}elseif(isset($arquivo) && $arquivo == ''){
include "home.php";
}else{
include "categoria.php";
}
?>
</body>
</html>
categoria.php
<h1>Categoria</h1>
<?php
$pegaCat = mysql_query("SELCET * FROM urls WHERE categoria = '$arquivo'");
$pegaCount = mysql_num_rows($pegaCat);
if($pegaCount <= '0'){
echo 'Opssssssssss Não encontramos o que procura!';
}else{
echo '<ul>';
while($res = mysql_fetch_array($pegaCat)){
$titulo = $res['nome'];
$link = $res['slug'];
echo '<li>';
echo '<a href="'.$urlBase.'/'.$arquivo.'/'.$link.'" title="'.$titulo.'">'.$titulo.'</a>';
echo '</li>';
}
echo '</ul>';
}
?>Carregando comentários...