Some advice / points / help

This is a discussion on Some advice / points / help within the PHP General forums, part of the PHP Programming Forums category; Hi guys, Some intelligent minds needed again ... I have the following "schematic" to work to ... http//steven.macintyre....


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2007
Steven Macintyre
 
Posts: n/a
Default Some advice / points / help

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

Now, as you can see the time slot are the items "show_start", "show_end"
(which I can do) the names are from the table (who) - can anyone start me
off on the correct route to get this done.

The layout does not have to be exactly like that - but - the days across top
have to - so if there are gaps in "time slots" etc we can handle that


This is way beyond my level of knowledge and have NO idea where to start.

As always - your assistance appreciated!!



Kind Regards,


Steven Macintyre
http://steven.macintyre.name
--

http://www.friends4friends.co.za
Reply With Quote
  #2 (permalink)  
Old 01-05-2007
Jochem Maas
 
Posts: n/a
Default Re: [PHP] Some advice / points / help

Steven Macintyre wrote:
> Hi guys,
>
> Some intelligent minds needed again ...


I dont think I count - mostly because I don't even
understand the question.

> I have the following "schematic" to
> work to ...
>
> http//steven.macintyre.name/arb/showlineups.jpg


that URL make my browser end up here:

http://www.w3.org/Protocols/

is .name even a top level domain? did that happen whilst I was sleeping?

>
> 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
>
> Now, as you can see the time slot are the items "show_start", "show_end"
> (which I can do) the names are from the table (who) - can anyone start me
> off on the correct route to get this done.
>
> The layout does not have to be exactly like that - but - the days across top
> have to - so if there are gaps in "time slots" etc we can handle that
>
>
> This is way beyond my level of knowledge and have NO idea where to start.


in very broad terms (with out taking any account of error checking):

0. connect to mysql database

http://php.net/mysql
http://php.net/manual/en/function.mysql-connect.php

1. define an sql query

e.g. $sql = "SELECT * kayasite_schedule"; // lame example query

2. perform the query

http://php.net/manual/en/function.mysql-query.php

3. loop the result to output tabular data

http://php.net/manual/en/function.mysql-fetch-assoc.php
http://php.net/foreach
http://php.net/echo

>
> As always - your assistance appreciated!!


the manual is your best friend, if you don't understand something in the manual
(i.e. the links above) come back and ask ... don't forget to tell us where/what you don't
understand :-)

good luck

>
>
>
> Kind Regards,
>
>
> Steven Macintyre
> http://steven.macintyre.name
> --
>
> http://www.friends4friends.co.za
>

Reply With Quote
  #3 (permalink)  
Old 01-05-2007
Stut
 
Posts: n/a
Default Re: [PHP] Some advice / points / help

Jochem Maas wrote:
> Steven Macintyre wrote:
>
>> I have the following "schematic" to
>> work to ...
>>
>> http//steven.macintyre.name/arb/showlineups.jpg
>>

>
> that URL make my browser end up here:
>
> http://www.w3.org/Protocols/
>
> is .name even a top level domain? did that happen whilst I was sleeping?
>


It's the missing : from http:// that does it. And yes, .name is a TLD,
has been for a while now.

> the manual is your best friend, if you don't understand something in the manual
> (i.e. the links above) come back and ask ... don't forget to tell us where/what you don't
> understand :-)
>


Don't forget Google, your second best friend. Google for php mysql
tutorial and you'll find a ton of stuff.

-Stut
Reply With Quote
  #4 (permalink)  
Old 01-05-2007
Roman Neuhauser
 
Posts: n/a
Default Re: [PHP] Some advice / points / help

# jochem@iamjochem.com / 2007-01-05 16:37:27 +0100:
> Steven Macintyre wrote:
> > http//steven.macintyre.name/arb/showlineups.jpg

>
> that URL make my browser end up here:
>
> http://www.w3.org/Protocols/
>
> is .name even a top level domain? did that happen whilst I was sleeping?


That's because of the "http//" (notice the missing colon).
name. is a valid TLD, just like museum.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
Reply With Quote
  #5 (permalink)  
Old 01-05-2007
Jochem Maas
 
Posts: n/a
Default Re: [PHP] Some advice / points / help

Roman Neuhauser wrote:
> # jochem@iamjochem.com / 2007-01-05 16:37:27 +0100:
>> Steven Macintyre wrote:
>>> http//steven.macintyre.name/arb/showlineups.jpg

>> that URL make my browser end up here:
>>
>> http://www.w3.org/Protocols/
>>
>> is .name even a top level domain? did that happen whilst I was sleeping?

>
> That's because of the "http//" (notice the missing colon).


that'll teach me to actually look and read :-P

> name. is a valid TLD, just like museum.


.... now .museum. I did know about, I've even been to one once ... but that
was long ago, keep it to yourself.

>

Reply With Quote
  #6 (permalink)  
Old 01-05-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] Some advice / points / help





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?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0