Changeset 55


Ignore:
Timestamp:
Aug 21, 2007, 3:52:22 PM (17 years ago)
Author:
george
Message:

Oprava přístupu do databáze.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • administrace/george/gm_news.php

    r11 r55  
    1 <?
    2 include_once('db.php');
    3 include('../../config.php');
    4 DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'wow');
    5 //DB_Query('SET CHARACTER SET cp1250');
     1<?php
     2$Database->select_db('wow');
    63
    74if(array_key_exists('action', $_GET))
     
    118    if(array_key_exists('message', $_POST) and array_key_exists('author', $_POST))
    129    { 
    13       DB_Insert('gm_news', array('time' => 'NOW()', 'author' => $_POST['author'], 'text' => $_POST['message']));
     10      $Database->insert('gm_news', array('time' => 'NOW()', 'author' => $_POST['author'], 'text' => $_POST['message']));
    1411      echo('Zpráva byla pøidána!<br>Pokraèujte <a href="../master.php">zde</a>.');   
    1512    } else echo('Nebyly zadány požadováné údaje pro pøidání aktuality!');
    1613  } else if($_GET['action'] == 'show_all')
    1714  {
    18     DB_Select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC');
    19     while($Row = DB_Row())
     15    $DbResult = $Database->select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC');
     16    while($Row = $DbResult->fetch_array())
    2017    {
    2118      echo('<span class="SpanAktuality">'.date('j.n.Y G:i', $Row['UNIX_TIMESTAMP(time)']).'</span> - '.$Row['author'].': '.$Row['text'].'<br>');
     
    2320  } else echo('Neznámá akce!');
    2421} else {
    25   DB_Select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC LIMIT 0, 25');
    26   while($Row = DB_Row())
     22  $DbResult = $Database->select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC LIMIT 0, 25');
     23  while($Row = $DbResult->fetch_array())
    2724  {
    2825    echo('<span class="SpanAktuality">'.date('j.n.Y G:i', $Row['UNIX_TIMESTAMP(time)']).'</span> - '.$Row['author'].': '.$Row['text'].'<br>');
Note: See TracChangeset for help on using the changeset viewer.