I am trying to write a simple stream, streaming everything from a mysql field. But my current script shows absolutely nothing.. no errors, nothing. Here it is:
include("user_sytem_scripts/connect.php");
$sql_updates = mysql_query("SELECT item_id, username, item_content, update_time FROM updates ORDER BY update_time DESC LIMIT 30") or die("Query failed with error: ".mysql_error());
while($row = mysql_fetch_array($sql_updates)){
$update_id = $row["item_id"];
$update_username = $row["username"];
$item_content = $row["item_content"];
$update_time = $row["update_time"];
$updatestream = '
<table style="background-color:#FFF; border:#999 1px solid; border-top:none;" cellpadding="5" width="100%">
<tr>
<td width="90%" valign="top" style="line-height:1.5em;">
<span class="liteGreyColor textsize9">' . $update_time . ' <a href="profile.php?id=' . $update_username . '"><strong>' . $username . '</strong></a> via <em></em></span><br />
' . $item_content . '
</td>
</tr></table>'; }
Then down in the HTML I use: <?php echo $updatestream ?>
But as i said i get absolutly nothing.. Can anyone spot any errors or general mistakes that would cause this? Thanks 😀
I would check the following:
You should also change:
$updatestream = 'to$updatestream .=so that you append text, in the current while loop you’ll overwrite the last$updatestreamvalue.