HELP ME WITH RANDOM GALLERY PIX for V2

Started on the old forum in September 2010 · view the original in the archive · old links redirect here

#galleryv2

2 replies · 796 views · started 16 years ago · 1 min read

2 participants
ryaaaan Junior · 12 posts #1

Can somebody plz help me. i want the random gallery pix to show 6, 3 on top and 3underneath but no matter what i do it only shows 1!!!!

i will tank whoever tries to help me..

Im usin wapdesirev2 and heres the code im using

$main.=" "; $gallery=mysql_fetch_array(mysql_query("SELECT uid, path FROM gallery_files ORDER BY RAND() LIMIT 6")); $main.="<img src="$gallery[1]" width="60" height="60"/> "; $main.=" ";

Help Those Who Are In Need & They Will Thank You :)

something else Fellow · 2,296 posts #2
$main.="<p style=\"text-align: center\">";
$gal = mysql_query("SELECT uid, path FROM gallery_files ORDER BY RAND() LIMIT 6");
while ($gallery=mysql_fetch_array($gal)){
$main.="<img src=\"$gallery[1]\" width=\"60\" height=\"60\"/><br/>";
}
$main.="</p>";
something else Fellow · 2,296 posts #3

printing the code 6 times on the same page is to much hard coding if you use a while or for loop you save resources and loading time

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close