roundhost
01-27-2005, 06:34 PM
I am currently using the following code to retreive a random members URL:
$getnames = $DB_site->query("
SELECT
* FROM user
ORDER BY rand()
LIMIT 1
");
while($geturl = $DB_site->fetch_array($getnames))
{
if ($geturl[homepage] == null) {
$rnd_site = "<a href=\"http://www.roundhost.net\" target=\"blank\">http://www.roundhost.net</a>";
} else {
$rnd_site = "<a href=\"$geturl[homepage]\" target=\"blank\">$geturl[homepage]</a>";
}
}
However, i would like it so that it always gets a member that has a url, rather than changing it to point to roundhost if their url is empty...how could i do this? It should be easy but all my attempts have failed! :(
Thanks in advance,
RoundHost
$getnames = $DB_site->query("
SELECT
* FROM user
ORDER BY rand()
LIMIT 1
");
while($geturl = $DB_site->fetch_array($getnames))
{
if ($geturl[homepage] == null) {
$rnd_site = "<a href=\"http://www.roundhost.net\" target=\"blank\">http://www.roundhost.net</a>";
} else {
$rnd_site = "<a href=\"$geturl[homepage]\" target=\"blank\">$geturl[homepage]</a>";
}
}
However, i would like it so that it always gets a member that has a url, rather than changing it to point to roundhost if their url is empty...how could i do this? It should be easy but all my attempts have failed! :(
Thanks in advance,
RoundHost