I have a page here http://www.jlp.ie/past_events.php where I’d need the last ‘More’ “Calyx Charity Concert 2005 – November 2005” information to display on the right. For example this page http://www.jlp.ie/future_events.php does exactly what I want. I don’t know why the first page won’t display anything when the page loads and I’m not too sure how to go about making the last entry in the database appear. Both pages of code seem to be the same and below is the code from the first page above. Can anyone help me out and possibly tell me why one loads an image/text on the right and the other doesn’t?
Thanks
Brian
Code: Select all
<?php require_once('****/jpl.php'); ?>
<?php
$colname_GetNewsDetails = "1";
if (isset($_GET['id'])) {
$colname_GetNewsDetails = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($*****, $jpl);
$query_GetNewsDetails = sprintf("SELECT * FROM future_events WHERE id = %s", $colname_GetNewsDetails);
$GetNewsDetails = mysql_query($query_GetNewsDetails, $jpl) or die(mysql_error());
$row_GetNewsDetails = mysql_fetch_assoc($GetNewsDetails);
$totalRows_GetNewsDetails = mysql_num_rows($GetNewsDetails);
mysql_select_db($*****, $jpl);
$query_GetNewsFuture = "SELECT id, heading, live FROM future_events ORDER BY sort ASC";
$GetNewsFuture = mysql_query($query_GetNewsFuture, $jpl) or die(mysql_error());
$row_GetNewsFuture = mysql_fetch_assoc($GetNewsFuture);
$totalRows_GetNewsFuture = mysql_num_rows($GetNewsFuture);
// Details of image 1 Main page
if (isset($row_GetNewsDetails['img']) && file_exists('images/'.$row_GetNewsDetails['img'])) {
$image_info_1 = getimagesize('images/'.$row_GetNewsDetails['img']);
}
$dims_1 = isset($image_info_1) ? $image_info_1[3] : '';
?>
<body>
<?php echo $row_GetNewsFuture['heading']; ?></td>
<a href="past_events.php?id=<?php echo $row_GetNewsFuture['id']; ?>"><img src="images/more.jpg" alt="Read More" width="34" height="13"></a>
<?PHP }; ?> <?php } while ($row_GetNewsFuture = mysql_fetch_assoc($GetNewsFuture)); ?>
<?php if ($dims_1) { echo $row_GetNewsDetails['heading']; ?>
<img src="images/<?php echo $row_GetNewsDetails['img']; ?>" alt="" <?php echo $dims_1; ?> /> <?PHP } ?>
<?php echo nl2br($row_GetNewsDetails['details']); ?>