Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Bugi w parserze, robi się śmietnik?
erix
post
Post #1





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




http://forum.php.pl/index.php?s=&showt...st&p=537834

Post a'la powyższy. Czy to ludzie wklejają jakieś śmieci, czy skrypt forum robi bałagan w listingach?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
piotrooo89
post
Post #2


Newsman


Grupa: Moderatorzy
Postów: 4 005
Pomógł: 548
Dołączył: 7.04.2008
Skąd: Trzebinia/Kraków




proszę:

Kod
<?php
$result = mysql_query('SELECT type, name FROM menu') or die(mysql_error());

if ($result) {
      while ($r=mysql_fetch_array($result))
       {  
                 echo '\n';
         echo $r['name'].'\n';
        
$result_1 = mysql_query('SELECT txt.txt_id, txt.menid, txt.alias, menu_links.anchor, menu_links.adres, menu_links.type FROM txt LEFT JOIN menu_links ON (txt.menid=menu_links.type) WHERE txt.menid=\"'.$r['type'].'\" AND menu_links.type=\"'.$r['type'].'\"') or die(mysql_error());
    
          while ($r1=mysql_fetch_array($result_1))
          {
         echo '[url=\"http://forum.php.pl/index.php?i=%27.$r1%5B%27txt_id%27%5D.%27\"]ť '.$r1['alias'].'[/url]\n';
               while ($r2=mysql_fetch_array($result_1))
               {
               echo '[url=\"http://.$r2%5b%27menu_links.adres%27%5d/\"]ť '.$r2['menu_links.anchor'].'[/url]\n';
               }
          }
        echo '\n';
            }
   }
?>


a tak w php:

  1. <?php
  2. $result = mysql_query('SELECT type, name FROM menu') or die(mysql_error());
  3.  
  4. if ($result) {
  5.      while ($r=mysql_fetch_array($result))
  6.       {  
  7.                 echo '\n';
  8.         echo $r['name'].'\n';
  9.        
  10. $result_1 = mysql_query('SELECT txt.txt_id, txt.menid, txt.alias, menu_links.anchor, menu_links.adres, menu_links.type FROM txt LEFT JOIN menu_links ON (txt.menid=menu_links.type) WHERE txt.menid=\"'.$r['type'].'\" AND menu_links.type=\"'.$r['type'].'\"') or die(mysql_error());
  11.    
  12.          while ($r1=mysql_fetch_array($result_1))
  13.          {
  14.         echo 'ť '.$r1['alias'].'\n';
  15.               while ($r2=mysql_fetch_array($result_1))
  16.               {
  17.               echo 'ť '.$r2['menu_links.anchor'].'\n';
  18.               }
  19.          }
  20.        echo '\n';
  21.            }
  22.   }
  23. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 27.12.2025 - 05:04