Show Random Topic

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

16 replies · 1,461 views · started 18 years ago · 1 min read

7 participants
khan1 Developer · 101 posts #1
    
echo "
Random Topic
";   
$lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY RAND() LIMIT 1"));
$tlnm = htmlspecialchars($lpt[1]);
$tpclnk = "<a
href=\"index.php?action=viewtpc&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
echo "$tpclnk
";
SiLeNce Developer · 138 posts #4

$random = mysql_fetch_array(mysql_query("SELECT url, uid FROM table_gallery ORDER BY RAND() LIMIT 1")); echo "<img src="$random[0]" alt="$random[1]"/>"; echo " "; $nick = getnick_uid($random[1]); $urlnick = "<a href="index.php?action=viewuser&sid=$sid&who=$random[1]"/>$nick</a>"; echo "by: $urlnick"; echo "

";

// for width n height .. just use the coded ~

echo "<img src="$random[0]" width="#" height="#" alt="$random[1]"/>";

amylee Principal · 1,092 posts #8

I try but not work... External image (may be gone)

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in

do you even have the table "table_gallery" in your database?

learner Lead · 587 posts #14

sweetangel try this

$rnd = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 1")); echo "<img src="$rnd[0]" alt="pic"/>

";

this will work for u External image (may be gone)

this time it will work

$rnd = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 1")); echo "<img src="$rnd[0]" alt="pic"/>

";

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

Guest #17

Do you mean on Random User Profile? Like refresh topic?

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