Ignore:
Timestamp:
May 7, 2009, 9:15:17 AM (15 years ago)
Author:
george
Message:
  • Opraveno: Chyba v CSS stylech způsobovala špatné zobrazení rámečků tabulek a stylů dalších prvnků.
  • Upraveno: Sjednocen styl různých tabulek.
  • Upraveno: Přepis nejednotného přístupu k databázi přes jiné proměnné a konstanty než dle konfigurace proměnné $Config.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/admin_novinky_modify.php

    r470 r583  
    2222endif;
    2323
    24 mysql_connect($db_server, $db_user, $db_pass);
    25   mysql_select_db($db_webu);
    26   mysql_query("SET NAMES 'utf8'");
    27  $pocet = mysql_num_rows(mysql_query("SELECT id FROM articles $where"));
     24$DbResult = $db->query("SELECT id FROM articles $where")
     25$pocet = $DbResult->num_rows;
    2826   
    2927   if($pocet != 0):
    3028   echo"<table align=center border=1><tr><td><b>Autor</b><td><b>Datum</b><td><b>Nadpis</b><td></tr>";
    3129   
    32  $query = mysql_query("SELECT * from articles $where order by date DESC");
    33  while($row = mysql_fetch_array($query)){
     30 $query = $db->query("SELECT * from articles $where order by date DESC");
     31 while($row = $query->fetch_array($query))
     32 {
    3433 $id = $row['id'];
    3534 echo"<tr>
     
    5251 $id = $_POST['id'];
    5352
    54 mysql_connect($db_server, $db_user, $db_pass);
    55   mysql_select_db($db_webu);
    56   mysql_query("SET NAMES 'utf8'");
    57    $query = mysql_query("SELECT * from articles where id='$id'");
     53   $query = $db->query("SELECT * from articles where id='$id'");
    5854   
    59    while($row = mysql_fetch_array($query)){
     55   while($row = $query->fetch_array())
     56   {
    6057   $autor = $row['autor'];
    6158    $title = $row['title'];
     
    112109          if($upravit==1 and $lvl > 0):
    113110           
    114   mysql_connect($db_server, $db_user, $db_pass);
    115   mysql_select_db($db_webu);
    116   mysql_query("SET NAMES 'utf8'");
    117    $upravit_autor = mysql_query("update articles set autor='$autor' where id='$id'");
    118    $upravit_title = mysql_query("update articles set title='$title' where id='$id'");
    119    $upravit_text = mysql_query("update articles set text='$text' where id='$id'");
    120    $upravit_kategorie = mysql_query("update articles set category='$kategorie' where id='$id'");
     111
     112   $upravit_autor = $db->query("update articles set autor='$autor' where id='$id'");
     113   $upravit_title = $db->query("update articles set title='$title' where id='$id'");
     114   $upravit_text = $db->query("update articles set text='$text' where id='$id'");
     115   $upravit_kategorie = $db->query("update articles set category='$kategorie' where id='$id'");
    121116 
    122117   if($upravit_autor and $upravit_title and $upravit_text and $upravit_kategorie):
     
    141136 
    142137 ?>
    143    
    144  
    145    
    146    
    147    
    148    
    149    
    150    
    151    
    152    
    153 
Note: See TracChangeset for help on using the changeset viewer.