Pagina 1 van 1

Newtopics.php

Geplaatst: 02 jan 2004, 23:38
door Bart-
Nou,
Ik heb een vraagje over :
newtopics.php.

Code: Selecteer alles

<?php

/********************************************************************************/
/* 										*/
/* newtopics.php - (c) 2002 Soeren Andersen (san@lerskov.com)			*/
/*										*/
/********************************************************************************/


/* SETTINGS START */

$dbhost    = "*****";				/* Your Database Host */
$dbuname   = "*****";				/* Your Database Username */
$dbpass    = "*****";				/* Your Database Password */
$dbname    = "*****";				/* Your Database Name */
$prefix    = "phpbb2_";					/* The phpbb2 database table prefix (usually phpbb2_ 

I think ...) */
$forum_url = "http://joudomein.nl";		/* The url of your phpbb2 forum */

/* SETTINGS END */

$dbi = mysql_connect($dbhost, $dbuname, $dbpass);
mysql_selectdb($dbname);

$result1 = mysql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."topics ORDER BY 

topic_last_post_id DESC LIMIT 10");
while(list($topic_id, $topic_last_post_id, $topic_title)= mysql_fetch_row($result1)) {
	$result2 = mysql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as 

post_time FROM ".$prefix."posts where post_id='$topic_last_post_id'");
	list($topic_id, $poster_id, $post_time)=mysql_fetch_row($result2);
        echo "$topic_title: ".$forum_url."viewtopic.php?p=$topic_last_post_id#$topic_last_post_id<BR>\n";
}

?>
De bedoeling van dit script is dat je op IRC de laatste 10posts op t forum kan zien.

Als ik het probeer te installeren staat er :

Code: Selecteer alles

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/virtual/site139/fst/var/www/html/test/phpBB2/newtopics.php on line 29
Ik heb vanalles geprobeerd, maar t lukt niet..

Kan iemand me helpen?

Alvast dank

Geplaatst: 03 jan 2004, 06:23
door WebSiteNet

Code: Selecteer alles

$dbhost    = "*****";            /* Your Database Host */ 
$dbuname   = "*****";            /* Your Database Username */ 
$dbpass    = "*****";            /* Your Database Password */ 
$dbname    = "*****";            /* Your Database Name */ 
$prefix    = "phpbb2_";               /* The phpbb2 database table prefix (usually phpbb2_ 
Heb je daar alles goed ingevuld? Let op: hier staat de standaard prefix verkeerd. Meestal heb je phpbb_