Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Database with events

Guest
Aug 23, 2006 Aug 23, 2006
I've got a database with records of events. I save every event with a date and now I would like have a list of alle events structured in day-order. Sometimes there are to event and sometimes there ten event per day.

How do I get a block for each day like this:

http://www.husetmagstraede.dk/default.asp?id=1

I'm not the great code neard - so please tell me slowly how to do :-)

/Rudy
TOPICS
Server side applications
310
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 23, 2006 Aug 23, 2006
One way would be to build a couple of queries and build the page dynamically with php.
Like this

<?php

$host = 'localhost';
$user = 'user';
$pass = 'password''

$link = mysql_connect($host, $user, $pass);

$dateQry = "SELECT date from table_EventTable ORDER BY date";
$dateList = mysql_query($dateQry, $link) or die (mysql_error());
// do not close the link to the database yet...
?>
....... SOME HTML .........

<?php

// run through the list of dates
while ($rowDate = mysql_fetch_assoc ($dateList)) {
$currDate = $rowDate['date'];
echo $currDate . "\n";
$eventQry = "SELECT event, time, location FROM table_EventTable WHERE date = ' . $currDate;
$eventList = mysql_query($eventQry , $link) or die (mysql_error());
while ($rowEvent = mysql_fetch_assoc ($dateList)) {
$currEvent = $rowEvent['event'];
$currTime = $rowEvent['time'];
$currLoc = $rowEvent['location '];
echo 'At ' . $currTime . ' ' . $currEvent . ' is happening here: ' . $currLoc . "\n";
}
}

mysql_free_result($eventList);
mysql_free_result($dateList );



You can apply tables and or other formatting in the code, but this will give a basic idea of ONE possible solution.

I hope this works for you!!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 23, 2006 Aug 23, 2006
Sorry, I forgot to tell that my site is an ASP site.

Can you do it in ASP?

/Rudy
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 23, 2006 Aug 23, 2006
LATEST
I am sorry, I cannot.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines