CREATE TABLE `newsy` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tytulpl` text collate utf8_polish_ci NOT NULL, `tytulde` text collate utf8_polish_ci NOT NULL, `tytulit` text collate utf8_polish_ci NOT NULL, `tytulgb` text collate utf8_polish_ci NOT NULL, `trescpl` text collate utf8_polish_ci NOT NULL, `trescde` text collate utf8_polish_ci NOT NULL, `trescit` text collate utf8_polish_ci NOT NULL, `trescgb` text collate utf8_polish_ci NOT NULL, `data` int(11) NOT NULL, `active` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci AUTO_INCREMENT=5 ;
fragment kodu php
<? . . . <br/><h1>Najnowsze informacje:</h1><br> <!--newsy --> <?php function shortcut($tresc,$ile) { if ($licz>=$ile) { $txt = $tnij.'...'; } else { $txt = $tresc; } return $txt; } # # tutaj deklarujemy ilosc znakow jaka ma nam wyswietlic skrypt #select tytul".$lang.", tresc".$lang." from tabela; $ile = 100; $query = mysql_query("select tytul".$lang." as tytul, tresc".$lang." as tresc from newsy WHERE active='1' order by id desc LIMIT 4"); { $temat = $go; $active = $rekord[5]; $id = $rekord[0]; } ?> ?>
Problem polega na zapytaniu do bazy danych, nie mogę wyświetlić takich danych jak tytuł i treść w zależności od $lang. Próbowałem w ten sposób ale nie wyświetla nic:
prin query wyświetla coś takiego Resource id #2. Prosiłbym o szybkie rozwiązanie problemu.
<?php $temat = $rekord("tytul") ?>
Pozdrawiam
Wojtek