Jump to content

[SOLVED] My output from mysql is messing up


chriscloyd

Recommended Posts

okay heres my problem

when i have my output echoed its showing L

heres my code

<?php
$dbhost = 'localhost';
$dbuser = '******';
$dbpass = '******';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = '******';
mysql_select_db($dbname);
//news//
$get_news = mysql_query("SELECT * FROM `cl_news` ORDER BY `news_id` DESC LIMIT 0 , 5");
if ($get_news) {
while ($news = mysql_fetch_assoc($get_news)) {
	$title = $news['news_title'];
	$news = $news['news_message'];
	$author = $news['news_author'];
	$date = $news['news_date'];
	$id = $news['news_id'];
	?>
	<table width="100%" border="0" cellspacing="1" cellpadding="0">
	<tr>
	<td colspan="2" class="headerright"><?php echo $title; ?>
	<a href="javascript:void();" class="style1" onclick="show_hide('<?php echo $id; ?>')">+/-</a></td>
	</tr>
	</table>
	<table id="<?php echo $id; ?>" width="100%" border="0" cellspacing="1" cellpadding="0">
	<tr>
	<td colspan="2" class="contentright"><?php echo $news; ?></td>
	</tr>
	<tr>
	<td width="68%" class="contentright">Posted on : <?php echo $author; ?><br>
	On : <?php echo $date; ?><br>
	</td>
	<td width="32%" class="contentright"><a href="view_news.php?id=<?php echo $id; ?>">Comments (0)</a> </td>
	</tr>
	</table>
	<?php	
}
} else {
echo 'Theres no news to display right now. Sorry for the inconvenience.';
}
?>

 

but on phpmyadmin i did the query because theres only 1 news article in there this is what shows up

 

SQL query: SELECT * FROM `cl_news` LIMIT 0, 15 ;

Rows: 1

news_id news_title news_author news_date news_views news_message

1 This is a test news haqshot Wednesday, February 28, 2007 2:52pm 0 Lorem ipsum dolor sit amet, consectetuer adipiscin...

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.