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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.