I need random 5 photo gallery code for lavalair wml version.. Please coders help me with this code.. Thanks
Random picture!
Collapse
X
-
GuestTags: None
-
guys i have this code how can i change the random image to a one user pic
Code:$user = getnick_uid($pic[0]); $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1")); $user = getnick_uid($pic[0]); $user = getnick_uid($pic[0]); echo "<a href=\"gallery2.php?action=viewuser&sid=$sid&who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>"; $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1")); $user = getnick_uid($pic[0]); echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>"; $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1")); $user = getnick_uid($pic[0]); echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>"; $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1")); $user = getnick_uid($pic[0]); echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>"; $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1")); $user = getnick_uid($pic[0]); echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
Comment
-
Originally posted by Ghetto888 View PostI need random 5 photo gallery code for lavalair wml version.. Please coders help me with this code.. Thanks
if u have other sql of gallery then change according to it
PHP Code:echo "<br/><b><u><i>Random Image:</i></u></b><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl FROM fun_gallery ORDER BY RAND() LIMIT 1"));
$nick = getnick_uid($sql[0]);
echo "<img src=\"$sql[1]\" alt=\"$sql[0]\"/><br/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a><br/>-----<br/>";
Comment
-
Guest
-
here is wml gallery
with sql
use this ghetto
PHP Code:-- --------------------------------------------------------
--
-- Table structure for table `fun_galcomments`
--
CREATE TABLE IF NOT EXISTS `fun_galcomments` (
`id` int(99) NOT NULL auto_increment,
`pid` int(99) NOT NULL default '0',
`text` varchar(200) NOT NULL default '',
`byuser` varchar(100) NOT NULL default '',
`time` varchar(99) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `text` (`text`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=47 ;
--
-- Dumping data for table `fun_galcomments`
--
-- --------------------------------------------------------
--
-- Table structure for table `fun_gallery`
--
CREATE TABLE IF NOT EXISTS `fun_gallery` (
`id` int(100) NOT NULL auto_increment,
`uid` int(100) NOT NULL default '0',
`sex` varchar(255) NOT NULL default '',
`itemurl` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`itemurl`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=196 ;
--
-- Dumping data for table `fun_gallery`
--
-- --------------------------------------------------------
--
-- Table structure for table `fun_prate`
--
CREATE TABLE IF NOT EXISTS `fun_prate` (
`id` int(100) NOT NULL auto_increment,
`pid` int(100) NOT NULL default '0',
`uid` int(100) NOT NULL default '0',
`prate` char(1) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `fun_prate`
--
-- --------------------------------------------------------
--
-- Table structure for table `gallery`
--
CREATE TABLE IF NOT EXISTS `gallery` (
`id` int(100) NOT NULL auto_increment,
`uid` varchar(100) NOT NULL default '',
`file` varchar(250) NOT NULL default '',
`sex` char(1) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `gallery`
--
Attached Files
Comment
-
echo "<br/><b><u><i>Random Image:</i></u></b><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl FROM fun_gallery ORDER BY RAND() LIMIT 1"));
$nick = getnick_uid($sql[0]);
echo "<img src=\"$sql[1]\" alt=\"$sql[0]\"/><br/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a><br/>-----<br/>";
LIMIT 1 is not working.it still show 1 picture if we chang to LIMIT 4, LIMIT 5 or LIMIT 6
anybody have the answer?
Comment
Comment