Phorum.ro
Your Avatar Welcome to Phorum.ro!
If you haven't registered yet, click here!
Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Du-te înapoi   Phorum.ro > Web Design & Web Development > Programare > PHP > PHP DB

PHP DB Discutii despre lucrul cu baze de date in PHP.

Răspunde
 
Thread Tools Moduri de afișare
Vechi 01.05.2006   #1
Elmo
128-Bit Member
 
Elmo's Avatar
 
Data înregistrării: 07.08.2005
Locație: Home
Mesaje: 736
Rep Power: 7
Elmo is on a distinguished road
Trimite un mesaj prin Yahoo pentru Elmo
Implicit Pagini ...

Deci am un script de news cu admin si add news dar scriptul nu afisiaza in pagina decat 20 de stiri dupa care cele vechi dispar cu toate ca ele raman in baza de date ... cum as putea face dupa 20 de afisari sa nu mai dispara alea vechi sa sa se puna pagini ? sa fie pagina 1 2 3 4 etC ... Cred ca ceva de aici m-ar interesa http://www.php4.as.ro/pag.php?pagina..._prev_next.php dar nush unde sa il bag poate imi ziceti ce imi trebuie din scriptul ala si unde sa il adaug aici
Cod PHP:
<?php 

// DO NOT EDIT BETWEEN THESE MARKS 
//////////////////////////////////// 
require("aminit/wsdinews.settings.inc.php"); 
$newstable "$sql_prefix"
$newstable .= "_articles"

 
$sql mysql_connect("$sql_host""$sql_user""$sql_pass") or die("$connection_error"); 
 
mysql_select_db("$sql_dbas") or die("$select_error"); 
 
$query "SELECT * FROM $newstable ORDER by id DESC LIMIT $display"
 
$result mysql_query($query) or die("$query_error"); 

      while (
$info mysql_fetch_array($result)) { 

            
$poster $info['poster']; 
            
$sdate $info['sdate']; 
            
$news $info['news']; 
            
$subject $info['subject']; 
///////////////////////////////////////////////// 
// YOU MAY EDIT BELOW TILL THE NEXT MARK 
// YOU MUST USE \" OR ' FOR " OR IT WILL 
// PRODUCE ERRORS DO NOT CHANGE VALUES 
// SUCH AS $subject $poster $news or $sdate 
// leave them where they are or it will not run 
///////////////////////////////////////////////// 
echo "   <CENTER><TABLE WIDTH=\"50%\" BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\"> 
 <TH ALIGN=\"left\" VALIGN=\"TOP\" COLSPAN=\"1\" bgcolor=\"#D8E0E8\"> 
    <font size=\"2\"><u>Subject</u> $subject  - <u>Posted By</u> $poster </font> 
        </TH> 
  <TR ALIGN=\"LEFT\" VALIGN=\"TOP\"> 
   <TD WIDTH=\"50%\" ALIGN=\"LEFT\" VALIGN=\"TOP\" bgcolor=\"#ECF0F4\"> 
<p>&nbsp;&nbsp;<font size=\"2\"> $news </font></p> 
 <font size=\"1\">Posted On $sdate</font> 
   </TD> 
  </TR> 
</TABLE></CENTER>"


/////////////////////////////////////////// 
// EDIT BELOW HERE AT YOUR OWN RISK 
/////////////////////////////////////////// 



mysql_free_result($result); 
mysql_close($sql); 

?>
Imi poate face cineva codul va rog ca eu m-am chinuit dar nu am reusit
Elmo is offline   Reply With Quote
Sponsored Links
Răspunde


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Moduri de afișare

Reguli de postare
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Pornit
emoticoanele sunt Pornit
Codul [IMG] este Pornit
Codul HTML este Oprit



Ora este GMT +3. Ora este acum 11:37:17.


Rulează cu: vBulletin Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum SEO by Zoints

XXXXXXXXXXXXXXXXXXX
Inactive Reminders By Icora Web Design