BrighteyesDesign
asked on
Add link to PHP Populated drop down menu
I have a dropdown menu working which populates it's info from a database using PHP.
The query code is...
<?php
$dbhandle = new mysqli('localhost', 'un', pw, 'db');
$result = $dbhandle->query("SELECT e.*, DATE_FORMAT(`eventdate`,'% Y') as y FROM `events` e WHERE (`title` IS NOT NULL) AND Trim(`title`)!='' ORDER BY `eventdate` DESC");
$curyear = null;
while ($row = $result->fetch_object())
{
if( $curyear!=$row->y )
{
if ($curyear != null) echo '</div>';
$curyear=$row->y;
echo '<div class=header id=divHeader', $curyear, '>', $curyear, '</div>';
echo '<div class=content id=divContent', $curyear, '>';
}
echo $row->title, '<br />';
}
echo '</div>';
$dbhandle->close();
?>
It's all working fine ...http://www.anjoman.co.uk/previous-eventsbin.php
All I need to do is add a link to the event title that appear when the date is clicked.
The URL they need to go to is the event details page...<a href="previous-events-arch ive.php?da te=<?php echo $row_events['eventdate']; ?>
I can't figure out where and how to place this link and would be grateful for any suggestions..
The query code is...
<?php
$dbhandle = new mysqli('localhost', 'un', pw, 'db');
$result = $dbhandle->query("SELECT e.*, DATE_FORMAT(`eventdate`,'%
$curyear = null;
while ($row = $result->fetch_object())
{
if( $curyear!=$row->y )
{
if ($curyear != null) echo '</div>';
$curyear=$row->y;
echo '<div class=header id=divHeader', $curyear, '>', $curyear, '</div>';
echo '<div class=content id=divContent', $curyear, '>';
}
echo $row->title, '<br />';
}
echo '</div>';
$dbhandle->close();
?>
It's all working fine ...http://www.anjoman.co.uk/previous-eventsbin.php
All I need to do is add a link to the event title that appear when the date is clicked.
The URL they need to go to is the event details page...<a href="previous-events-arch
I can't figure out where and how to place this link and would be grateful for any suggestions..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER