<?php $galclass = new Gallery; $randomid = $galclass->randompic(); ?>
Plik jest odpowiedzialny za wyświetlanie losowego zdjęcia z galerii. Cały problem polega na tym, że chciałbym aby pod losowym obrazkiem wyświetlał się jego tytuł. Nie mam pojęcia jak to zrobić, nie umiem zbytnio php, ale coś tam potrafie, w tym przypadku poddaje się.
SQL:
CREATE TABLE IF NOT EXISTS `webs_gallery_pictures` ( `picID` int(11) NOT NULL AUTO_INCREMENT, `galleryID` int(11) NOT NULL, `name` varchar(255) NOT NULL, `comment` text NOT NULL, `views` int(11) NOT NULL DEFAULT '0', `comments` int(1) NOT NULL DEFAULT '1', `votes` int(11) NOT NULL, `points` int(11) NOT NULL, `rating` int(11) NOT NULL, PRIMARY KEY (`picID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; INSERT INTO `webs_gallery_pictures` (`picID`, `galleryID`, `name`, `comment`, `views`, `comments`, `votes`, `points`, `rating`) VALUES (5, 1, 'pies', 'd', 32, 2, 0, 0, 0), (4, 1, 'labedz', 'sdsd', 169, 2, 0, 0, 0), (6, 1, 'kon', 'ty', 77, 2, 0, 0, 0);