View Single Post
03-21-2007, 11:55 PM
#7
VincePirez is offline VincePirez
Status: Sin Binner
Join date: Mar 2007
Location:
Expertise:
Software:
 
Posts: 19
iTrader: 0 / 0%
 

VincePirez is on a distinguished road

  Old

[QUOTE=ali.black;320182]here is the php to display the info posted.

PHP Code:
<?php
include ('mysql_connect.php');
$query "SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news_posts";
$result = @mysql_query($query);
 
if (
$result) {
while (
$row mysql_fetch_array($resultMYSQL_ASSOC)) {
$url 'comments.php?id='.$row['id'];
echo 
'<p><b>'.$row['title'].'</b><br><br>
'
<div id="mtext">.$row['post'].</div>'<br><br>
Posted by : <b>'
.$row['author'];
}
} else {
echo 
'There are no news posts to display';
}
?>
First off, your PHP is incorrect. The if($result) part merely checks that the MySQL query executed without any problems. It DOES NOT tell you if there are any new rows. You will need to use mysql_num_rows to check for this, for example:

PHP Code:
if (mysql_num_rows($result) > 0) { /* Do something */ 
Secondly, unfortunately I don't really understand your question.....