Jump to content

repeating mysql stored data


htmlstig

Recommended Posts

sorry if i have posted this in the wrong place, wasnt sure wether to post here or mysql.

 

I have made a php calendar, and i am now wanting it to show if there is an event on that day and if so show it in a tool tip. the tool tip is populated by what is in the title="" of the link so i need my events to be shown in there. I have figured out how to show the event but now i am stuck on how to show all events if there is more than one one that day, how i have set it seems to only the second event, probably as the second variable overwrote the first variable.

 

this is the code i have at the minute ..............

$result = mysql_query("SELECT * FROM events WHERE day='$day_num' AND month='$fullmonth' AND year='$year'") or die(mysql_error());

$rows= mysql_num_rows($result);
if ($rows !="false"){
while($rowout = mysql_fetch_array($result)) {
$todayis = $rowout['day'] ."-". $rowout['month'] ."-". $rowout['year'] ."<br>";
$title= $rowout['event'] ."<br><br>";}
$firstl = "<a href='' title='". $todayis . $title ."'>";
$lastl = "</a>";}
else {$firstl = ""; $lastl = "";}

 

then to display the day and links .................

 

<td><? echo $firstl; ?><? print $day_num; ?><? echo $lastl; ?></td>

 

 

could some one be so kind and help me write it so that it displays all events?

 

here is a link to the calendar, incase its needed. http://www.scripttesting.htmlstig.com/calendar/index.php

 

Many thanks

Carl

Link to comment
https://forums.phpfreaks.com/topic/215249-repeating-mysql-stored-data/
Share on other sites

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.