sickman Posted April 23, 2010 Report Share Posted April 23, 2010 man vajag lai šo scriptu piem varētu sadalīt pa lapām vienas ziņas tabuliņa vienā lapā! esmu nočakarējies līddz bezsamaņai nekas neiznāāk :( <table cellspacing="0px" width="100%"> <tr> <td valign="top"> <h3>Jaunumi</h3> <?php $db = mysql_connect("localhost","jaaajaaa","startstart") or die(mysql_error()); mysql_select_db("php_lapa",$db ); $result = mysql_query("SELECT ID, title, date, description, author FROM jaunumi",$db); $myrow = mysql_fetch_array($result); do { printf(" <table class='lessons' align='center'> <tr> <td class='lessons_title'><p class='lesson_name'><a href='view_news.php?ID=%s'> %s</a></p> <p class='lesson_adds'>Pievienoрanas datums: %s</p> <p class='lesson_adds'>Autors: %s</p></td> </tr> <tr> <td>%s<td> </tr> </table><br> <br>",$myrow["ID"], $myrow["title"],$myrow["date"],$myrow["author"], $myrow["description"]); } While ($myrow =mysql_fetch_array($result)); ?> </td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
briedis Posted April 23, 2010 Report Share Posted April 23, 2010 (edited) Varbūt der pameklēt forumā? 101. šāds jautājums jau ir bijis... Edited April 23, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
sickman Posted April 23, 2010 Author Report Share Posted April 23, 2010 es tikkai maacos taadeelj prasu kaa var pagination visaadus veidus esmu izgaajis caur Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 23, 2010 Report Share Posted April 23, 2010 Nu, ja esi izgājis visādus veidus, tad vajadzētu beidzot pamēģināt no foruma satura paņemt ;) Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted April 23, 2010 Report Share Posted April 23, 2010 ierakstu dalīšana pa lappusēm * http://php.lv/f/inde...?showtopic=2062 * http://php.lv/f/inde...p?showtopic=765 * http://php.lv/f/inde...?showtopic=1330 * http://php.lv/f/inde...?showtopic=2881 * http://php.lv/f/inde...?showtopic=2788 Meklēt te: http://php.lv/f/topic/2935-neliels-foruma-temu-apkopojums-no-arhiva-sadalas/ Quote Link to comment Share on other sites More sharing options...
sickman Posted April 23, 2010 Author Report Share Posted April 23, 2010 Nu, ja esi izgājis visādus veidus, tad vajadzētu beidzot pamēģināt no foruma satura paņemt ;) neesu jau naglijs bet kaads nevar paliidzeet uzreiz sadaliit es no kodeeshanas veel iisti neko nerubiiju daudz taakaa paliidziiba man nodereetu! Quote Link to comment Share on other sites More sharing options...
sickman Posted April 23, 2010 Author Report Share Posted April 23, 2010 (edited) ierakstu dalīšana pa lappusēm * http://php.lv/f/inde...?showtopic=2062 * http://php.lv/f/inde...p?showtopic=765 * http://php.lv/f/inde...?showtopic=1330 * http://php.lv/f/inde...?showtopic=2881 * http://php.lv/f/inde...?showtopic=2788 Meklēt te: http://php.lv/f/topic/2935-neliels-foruma-temu-apkopojums-no-arhiva-sadalas/ ok bet tomaaer ja kaads var sadaliet plzzz Edited April 23, 2010 by sickman Quote Link to comment Share on other sites More sharing options...
briedis Posted April 23, 2010 Report Share Posted April 23, 2010 ok bet tomaaer ja kaads var sadaliet plzzz Kā tad ir - tu mācies, vai gribi lai kāds to izdara tavā vietā? Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 23, 2010 Report Share Posted April 23, 2010 Ko tik cilvēks neizdarīs par 0.99Ls ZZ kredītu :D Quote Link to comment Share on other sites More sharing options...
chizijs Posted April 23, 2010 Report Share Posted April 23, 2010 (edited) ahh.. chizijs, ka vienmēr palīdzēs nabadziņiem ^^ <?php if(!isset($_GET['page'])){ $lapa = 1; }else{ $lapa = $_GET['page']; } $max = 10; $no = (($lapa * $max) - $max); $tabula = "Mana tabula"; $sql = mysql_query("SELECT * FROM `'".$tabula."'` ORDER BY id DESC LIMIT $no, $maxs"); $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM `'".$tabula."'`"),0); $total_pages = ceil($total_results / $max_results); ?> <?php if(mysql_num_rows($sql) > 0){ while($t = mysql_fetch_array($sql)){ ?> <?php echo $t['kolona']; ?> <?php } ?> <?php if($lapa > 1){ $prev = ($lapa - 1); echo "<span class=\"pagecurrent\"><a href=\"?p=page=$prev\">«</a></span>"; } for($i = 1; $i <= $total_pages; $i++){ if(($lapa) == $i){ echo "<span class=\"pagecurrent2\">$i</span>"; } else { echo "<span class=\"pagecurrent\"><a href=\"?p=page=$i\"><b>$i</b></a></span>"; } } if($lapa < $total_pages){ $next = ($lapa + 1); echo "<span class=\"pagecurrent\"><a href=\"?p=page=$next\">»</a></span>"; } ?> Tikai labo pats.. Edited April 23, 2010 by chizijs Quote Link to comment Share on other sites More sharing options...
bobsters Posted April 23, 2010 Report Share Posted April 23, 2010 chizijs kā vienmēr palīdzēs nelaimē nonākušajiem jauniem koderiem kuri "mācās" kodēt lapu no tā ka viņiem uzraksta priekšā :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.