Changeset 583 for trunk/pages/admin_novinky_modify.php
- Timestamp:
- May 7, 2009, 9:15:17 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/admin_novinky_modify.php
r470 r583 22 22 endif; 23 23 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; 28 26 29 27 if($pocet != 0): 30 28 echo"<table align=center border=1><tr><td><b>Autor</b><td><b>Datum</b><td><b>Nadpis</b><td></tr>"; 31 29 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 { 34 33 $id = $row['id']; 35 34 echo"<tr> … … 52 51 $id = $_POST['id']; 53 52 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'"); 58 54 59 while($row = mysql_fetch_array($query)){ 55 while($row = $query->fetch_array()) 56 { 60 57 $autor = $row['autor']; 61 58 $title = $row['title']; … … 112 109 if($upravit==1 and $lvl > 0): 113 110 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'"); 121 116 122 117 if($upravit_autor and $upravit_title and $upravit_text and $upravit_kategorie): … … 141 136 142 137 ?> 143 144 145 146 147 148 149 150 151 152 153
Note:
See TracChangeset
for help on using the changeset viewer.