Re: Some advice / points / help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On Fri, January 5, 2007 9:07 am, Steven Macintyre wrote:
> Hi guys,
>
> Some intelligent minds needed again ... I have the following
> "schematic" to
> work to ...
>
> http//steven.macintyre.name/arb/showlineups.jpg
>
> I need to "fill" that with data from a mysql table ...
>
> The format of the table is as follows;
>
> CREATE TABLE `kayasite_schedule` (
>   `id` int(11) NOT NULL auto_increment,
>   `tid` int(6) NOT NULL,
>   `showname` mediumtext NOT NULL,
>   `day` varchar(10) NOT NULL,
>   `blurb` longtext NOT NULL,
>   `show_start` time NOT NULL default '00:00:00',
>   `show_end` time NOT NULL default '00:00:00',
>   `who` varchar(25) NOT NULL default '',
>   `uid` int(6) NOT NULL,
>   `pic` varchar(60) NOT NULL default '',
>   UNIQUE KEY `id` (`id`)
> ) ENGINE=MyISAM

//I always get date_format directives wrong.  Look them up.
$query = "select id, tid, showname, day, date_format(show_start,
'%h%a'), date_format(show_end '%h%a') ";
$query .= " from kayasite_schedule ";
$query .= " order by day, show_start ";
$shows = mysql_query($query, $connection) or
trigger_error(mysql_error($connection) . " $query");
$last_day = '';
$columns = array();

//The interesting thing to note is that the layout of start-times
//is actually very free-form
//So don't try to structure it too much!
echo "<table><tr valign=\"top\"><td><b>Mon-Thu</b><br />";
while (list($id, $tid, $showname, $day, $show_start, $show_end) =
mysql_fetch_row($shows)){
  if ($day !== $last_day){
    echo "</td><td><b>$day</b><br />\n";
    $last_day = $day;
  }
  echo "<b>$show_start-$show_end</b><br />\n";
  echo $showname, "<br />\n";
  echo "<br />\n";
}
echo "</td></tr></table>\n";

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux