Freakindj
07-04-2005, 09:54 AM
I trying to find information on inserting a random topic from my .phpbb forums into my .htm pages
so far this is what I have come up with
[COLOR=Red]<td width="20%">
test
<?php
$dl = mysql_connect('localhost', 'xxxxx_xxxxxx', 'xxx');
if($dl){
$query = "SELECT count(phpbb2_posts_text) as phpbb2_posts_text";
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
srand(1000000*microtime());
$query = "SELECT phpbb2_posts_text, href FROM banners WHERE id=".rand(1, $value['phpbb2_posts_text']);
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
mysql_close($dl); ?>
<?=$value['phpbb2_posts_text']?>
<?php } // end of if($dl) ?>
</td>[/COLOR]
Has anyone ever tried this before
so far this is what I have come up with
[COLOR=Red]<td width="20%">
test
<?php
$dl = mysql_connect('localhost', 'xxxxx_xxxxxx', 'xxx');
if($dl){
$query = "SELECT count(phpbb2_posts_text) as phpbb2_posts_text";
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
srand(1000000*microtime());
$query = "SELECT phpbb2_posts_text, href FROM banners WHERE id=".rand(1, $value['phpbb2_posts_text']);
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
mysql_close($dl); ?>
<?=$value['phpbb2_posts_text']?>
<?php } // end of if($dl) ?>
</td>[/COLOR]
Has anyone ever tried this before