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