Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
foxbh

Paginação Em Colunas

Question

2 answers to this question

Recommended Posts

  • 0

Achei este exemplo mais não to consegindo faser a consulta , sempre da um erro

<?php



$bd = "geobras"; //Nome no Banco de Dados
$login = "teste"; // Nome do Usuario
$pass = "teste"; // senha
$host = "localhost";

$con=mysql_connect("$host","$login","$pass") or Die('erro 100 - Falha na Conexão');

$con2=mysql_select_db("$bd") or die(' Erro 102 - Falha ao Abrir Banco de Dados');

$sql = mysql_query("SELECT * FROM catalogo");



?>


<?php
echo "<table width=100 border=0>";
?>

<?php
$total = mysql_num_rows($sql);
?>


<?php
$colunas = "3";
?>

<?php
if ($total>0) {
    for ($i = 0; $i &lt; $total; $i++) {
        if (($i%$colunas)==0) {
        echo "&lt;/tr>";
        echo "&lt;tr>";
    }
?>


<?php
    $dados = mysql_fetch_array($sql);
    $nome = $dados["nome"];
    echo "<td>$nome</td>";
?> 




<?php
    }
} else {
    echo "Nenhum registro encontrado";
}
?> 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



  • Forum Statistics

    • Total Topics
      148079
    • Total Posts
      643267
×
×
  • Create New...