Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [php & mysql] problema paginazione

    codice
    Codice PHP:
    <?
    include("admin/config.inc.php");
    $lim mysql_fetch_array(mysql_query("SELECT limite_news FROM settings"$db));
    $limite 5
    if ( !isset(
    $start) OR $start $start 1;
    $news mysql_query("SELECT id, titolo, testo, data FROM news ORDER BY id DESC LIMIT $start$limite"$db);
    $conto mysql_fetch_array(mysql_query("SELECT COUNT(*) AS tot FROM news"$db));
    $pagine intval(($conto["tot"]) / $limite);
    ?>
    <html><head>
    <title>-=SkiM=-</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <link rel="stylesheet" type="text/css" href="css/main.css"></head>
    <body>
    <table style="background: url(img/bg.gif);" align="center" height="100%" width="100%">
    <tr><td align="center">
        <table bgcolor="#16160c" border="0" cellpadding="0" cellspacing="0" height="500" width="688">
         <tr><td height="26" width="26">[img]img/t_l.gif[/img]</td>
                <td style="background: url(img/t_c.gif) repeat-x;" align="right" valign="bottom">
                    [img]img/px.gif[/img][img]img/news.gif[/img][img]img/about_s.gif[/img][img]img/foto.gif[/img][img]img/music.gif[/img][img]img/top_line.gif[/img][img]img/logo.gif[/img]</td><td width="26">[img]img/t_r.gif[/img]</td></tr>
        <tr><td style="background:url(img/c_l.gif) repeat-y"></td>
               <td rowspan="2" style="background:url(img/b_c.gif) no-repeat center bottom" valign="top">
                <table border="0" cellpadding="0" cellspacing="0">
                   <tr><td>[img]img/px.gif[/img]</td>
                        <td class="text" style="border-bottom: 1px solid rgb(181, 199, 26);" valign="top" width="563">
    <div id="news">
    <?
    while ( $n mysql_fetch_array($news) ) {
        echo 
    "

    $n[data] » $n[titolo]
    $n[testo]</p>";
    }
    ?>


    [b]«[/b]
    <?
    for ($i 1$i $pagine AND $i $limite$i++)
    $start_page $i $limite;
    echo 
    "<a href=\"index.php?start=$start_page\"> $i </a> ";
    }
    ?>
    [b]»[/b]</p>
    </div></td>
                        <td>[img]img/dot.gif[/img]</td>
                    </tr></table></td>
                    <td style="background: transparent url(img/c_r.gif) repeat-y"></td></tr>
    <tr><td height="435">[img]img/b_l.gif[/img]</td><td>[img]img/b_r.gif[/img]</td></tr>
    </table>
    </td></tr></table>
    </body></html>
    $limite l'ho impostato a 5 per prova.
    come mai non mi fa vedere nulla pero? io ho inserito 1 news **

    Link pagina: http://www.hwzone.altervista.org/index.php

  2. #2
    Perche' hai messo $start a 1 invece che a zero.

    Il silenzio è spesso la cosa migliore. Pensa ... è gratis.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.