Jump to content

php and mysql -> december 31st, 1969


xionhack

Recommended Posts

have you pulled the required info needed? like all the rows? with post_time and such..

 

as im trying to publish what im about to show you to my website, but my server's ftp is updating lol

so i cant test it and tweak it lol

 

well my code is:

 

<?php
include("connect.php");
$getnews = mysql_query("SELECT * FROM phpbb_posts WHERE forum_id='4' ORDER BY post_time DESC");
$checknews = mysql_num_rows($getnews);

if($checknews==0)
{
echo 'No news as of yet!';
}
else
{
while($row = mysql_fetch_assoc($getnews))
{
	$date = date('g:ia - D jS M', strtotime($row['post_time']));
	echo '<tr><td>'.$row['post_subject'].'</td><td>'.$date.'</td></tr><br>
	<tr><td>'.nl2br($row['post_text']).'</td></tr>';
}
}
?>

 

please beware that this is obviously used for myself to my spec, hope it can help in anyway maybe...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.