Jump to content

Can not get entry to appear on page (writes to SQL)


kristiankeith

Recommended Posts

Below is my code... it writes to the SQL database but does not show on the HTML page. Any advice?

 

<?php

$query = mysql_query("SELECT * FROM `entries`");
$query = mysql_query("SELECT *, UNIX_TIMESTAMP(`date`) as date FROM `entries` ORDER BY `date` DESC LIMIT");
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">

<tr>
	<td valign="top">
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td valign="top" class="entrysmall" align="right">Posted on: <?php echo date("d/m/y g:i a", $row['date']); ?></td>
		</tr>
		<tr>
			<td valign="top">
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td valign="top" style="padding-right: 10px;"><span class="entrytitle">Name:</span></td>
					<td valign="bottom" width="100%"><?php echo htmlspecialchars(stripslashes($row['name'])); ?></td>
				</tr>
				<tr>
					<td valign="top" style="padding-right: 10px;" nowrap="nowrap"><span class="entrytitle">E-Mail:</span></td>
					<td valign="bottom" width="100%"><?php 
						$email = explode('@',stripslashes($row['email']));
						echo $email[0].' *at* '.$email[1];
						 ?></td>
				</tr>
					<td valign="top" style="padding-right: 10px;"><span class="entrytitle">Hometown:</span></td>
					<td valign="bottom" width="100%"><?php echo htmlspecialchars(stripslashes($row['hometown'])); ?></td>
				<tr>
					<td valign="top" style="padding: 5px 10px 0px 0px;" colspan="2"><span class="entrytitle">Message:</span></td>
				</tr>
				<tr>
					<td valign="top" style="padding-right: 10px;" colspan="2"><?php echo smilies(htmlspecialchars(stripslashes($row['message']))); ?></td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	</td>
</tr>
<tr>
	<td valign="top" height="10"></td>
</tr>

</table>

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.