Random Help

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

5 replies · 737 views · started 18 years ago · 1 min read

2 participants
jayasanka Developer · 128 posts #4

for random memeber

$sql = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_users ORDER BY RAND()  LIMIT 1"));
echo "Random Member: <a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$sql[1]</a>
";

do the rest things by yourself.

I`ll try to add Blog n Poll Like Dis Is It coorect..

$sql = "SELECT id, bname FROM ibwf_blogs WHERE bowner='".$who."' ORDER BY RAND()  LIMIT 1";
echo "<img src=\"../images/blogs.gif\" alt=\"*\"/> $f1<a href=\"lists.php?action=allbl&sid=$sid\"> ";
echo "Random blog ($noi[0])</a>$f2
";
$sql = "SELECT id, name FROM ibwf_users WHERE pollid>'0' ORDER BY RAND()  LIMIT 1";
 echo "<img src=\"images/polls.gif\" alt=\"*\"/>  $f1<a href=\"lists.php?action=polls&sid=$sid\">";
echo "Random poll($noi[0])</a>$f2
";

thnkz in advance ....

and how to add like dis

Newest Member
JD (23/Male/UK)
Single, 0 Credits
rukiya Lead · 569 posts #5

I`ll try to add Blog n Poll Like Dis Is It coorect..

$sql = "SELECT id, bname FROM ibwf_blogs WHERE bowner='".$who."' ORDER BY RAND()  LIMIT 1";
echo "<img src=\"../images/blogs.gif\" alt=\"*\"/> $f1<a href=\"lists.php?action=allbl&sid=$sid\"> ";
echo "Random blog ($noi[0])</a>$f2
";
$sql = "SELECT id, name FROM ibwf_users WHERE pollid>'0' ORDER BY RAND()  LIMIT 1";
 echo "<img src=\"images/polls.gif\" alt=\"*\"/>  $f1<a href=\"lists.php?action=polls&sid=$sid\">";
echo "Random poll($noi[0])</a>$f2
";

thnkz in advance ....

these codes are worng and full of bugs for random poll the code is

$sql = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_users WHERE pollid>'0' ORDER BY RAND()  LIMIT 1"));
if($sql[0]!="")
{
echo "<img src=\"images/polls.gif\" alt=\"*\"/>
Random Poll :By <a href=\"index.php?action=viewpl&who=$sql[0]&sid=$sid\">$sql[1]</a>

";
}

and how to add like dis

and for this type new member's info
Newest Member
JD (23/Male/UK)
Single, 0 Credits
$sql = mysql_fetch_array(mysql_query("SELECT id,name,plusses,sex,birthday,location  FROM ibwf_users ORDER BY regdate DESC LIMIT 0,1"));
$uage = getage($sql[4]);
  if($nopl[3]=='M')
  {
    $usex = "Male";
  }else if($sql[3]=='F'){
    $usex = "Female";
  }else{
    $usex = "Shemale";
  }
  $sql[5] = htmlspecialchars($sql[5]);
  
    echo "Newest Member
<a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$sql[1]</a> ($uage/$usex/$sql[5])
$sql[2] Credits
";

if you have marittal status row in ibwf_users table add it in my code correctly and rest the random blog code,make it yourself coz I wont help you for copy and paste work

jayasanka Developer · 128 posts #6

these codes are worng and full of bugs for random poll the code is

$sql = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_users WHERE pollid>'0' ORDER BY RAND()  LIMIT 1"));
if($sql[0]!="")
{
echo "<img src=\"images/polls.gif\" alt=\"*\"/>
Random Poll :By <a href=\"index.php?action=viewpl&who=$sql[0]&sid=$sid\">$sql[1]</a>

";
}
$sql = mysql_fetch_array(mysql_query("SELECT id,name,plusses,sex,birthday,location  FROM ibwf_users ORDER BY regdate DESC LIMIT 0,1"));
$uage = getage($sql[4]);
  if($nopl[3]=='M')
  {
    $usex = "Male";
  }else if($sql[3]=='F'){
    $usex = "Female";
  }else{
    $usex = "Shemale";
  }
  $sql[5] = htmlspecialchars($sql[5]);
  
    echo "Newest Member
<a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$sql[1]</a> ($uage/$usex/$sql[5])
$sql[2] Credits
";

if you have marittal status row in ibwf_users table add it in my code correctly and rest the random blog code,make it yourself coz I wont help you for copy and paste work

thnkz bro it wrks....

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