<?php Something is wrong in your syntax obok 'index' w linii 1 ?>
Cały skrypt wygląda tak :
<?php mysql_select_db('*******',$link); $count=10; $count = strip_tags($count); $count = htmlspecialchars($count); $count = addslashes($count); $offset=0; $offset = strip_tags($offset); $offset = htmlspecialchars($offset); $offset = addslashes($offset); echo 'Strona:'; if(isset($_GET['offset']))$offset = $count*$_GET['offset']; //numer strony $sql = "Select count(*) from index ORDER BY id DESC"; $result = mysql_query($sql, $link) or die(mysql_error()); $r = mysql_fetch_array($result); @$pages = ceil($r[0]/$count); $sql = "Select * from 'index' ORDER BY 'id' DESC Limit '.$count.' offset '.$offset.';"; $result = mysql_query($sql,$link) or die(mysql_error()); for($i=0;$i<$pages;$i++){ if($i*$count==$offset){ echo ' '.$i.' '; } else { echo '<a href="index.php?count='.$count.'&offset='.$i.'"> '.$i.' </a>'; } } while(($row=mysql_fetch_array($result))!=NULL){ echo '<h2>' . $row['tytul'] . '</h2><br>'; echo '' . $row['tresc'] . '<br><br>'; echo '<div class="autor">Autor: ' . $row['autor'] . ' '; echo 'Data: ' . $row['data'] . '</div><br>; } ?>
Tabela index w MySQL wygląda tak :
<?php -- Struktura tabeli dla `index` -- CREATE TABLE `index` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tytul` text NOT NULL, `autor` varchar(100) NOT NULL DEFAULT '', `data` varchar(100) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '', `tresc` text NOT NULL, ) ENGINE=MyISAM DEFAULT CHARSET=latin2 AUTO_INCREMENT=6 ; ?>
Wersje oprogramowania :
<?php php 5.2.6 sql 5.1.28-rc-log ?>
Bardzo proszę o pomoc, pozdrawiam.