This is a discussion on Help needed with php table layout within the Coding Help forums, part of the Webmaster Discussion category; Hi all, I’m trying to learn php for a project to make an online schedule for the trainers in our ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I’m trying to learn php for a project to make an online schedule for the trainers in our department. It will replace a MS Excel workbook and must be able to display the each of the trainer’s names in the first row and underneath each trainer’s name related schedule data should be displayed in a column for each trainer in the following format |Maria | Graham | |Date | Date | |Comments | Comments | |Date | Date | |Comments | Comments | I have two MySQL tables that contain the data that are linked by the trainers, the structure of the tables are as follows The Trainers Table +-------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+----------------+ | ID | int(10) | NO | PRI | NULL | auto_increment | | Fname | char(10) | NO | | NULL | | | Lname | char(10) | NO | | NULL | | +-------+----------+------+-----+---------+----------------+ The Schedule Table +----------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+------------------+------+-----+---------+-------+ | Sdate | date | NO | | NULL | | | Trainer | int(10) unsigned | NO | | NULL | | | Comments | varchar(35) | YES | | NULL | | +----------+------------------+------+-----+---------+-------+ I’ve tried to work this out but I can’t get the page to display correctly and I was wondering if anyone here could have a look at my code and give me some pointers on where I’m going wrong. Thanks in advance, Graham. Here is my php code PHP Code:
__________________ There are two types of people in this world the closed minded ignorant and the open minded learner. Be the latter |
| |||||
| wasn't that meant to be ........from Schedule............
__________________ :. Web Design & Development Web Design Ireland :. Search Engines Optimization Search Engines Optimization :. Car Parts & Accessories Car Parts :. Cars Ireland Cars Ireland :. I Have 2 Find It Directory SEF Directory |
| ||||
| Hi all, As regard the schedule table I know I typed in incorrectly when setting it up but it is actually called scheule but it is just a test DB to see if I can get things up and running before I set up the project DB. As regard trainer/ Trainer I just typed in the name of the talbe in leading caps out of habit for the post they are all in lower cae in the DB. Sorry if these mistakes are causing ye problems and thanks for the help. Graham |
| |||||
| did u at least get it sorted? |
| ||||
| Hi Louie, No it still won't display correctly for me have to admit I'm a bit over my head here. I was even trying to get the data out in seperate tables but I can't get it into the format I need it keeps giving me a table for each record in the related tables i.e. four tables for the first trainer and one for the second trainer. Head banging time. |
| |||||
| lets look at it this way. you have a master_tbl and a sub_tbl related to the master_tbl by an id. now all you have to do is 1. query the master_tbl, get all the data available put the master_id into a variable 2. using while... loop, query the sub_tbl filtering by master_id, for any data related to it and if any display it. 3. close loop, and record set 4. close connection |
| Tags |
| layout, needed, php, table |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP, OOPS! data typing | Mike | Coding Help | 2 | 24-08-2007 02:44 PM |
| php mysql repeat region | Keewee6 | Coding Help | 7 | 14-08-2007 05:50 PM |
| Table layout vs CSS layout ... | dbee | Coding Help | 21 | 12-07-2007 11:57 AM |
| WTF - Some PHP Obfuscation. | daviddoran | General Chat | 8 | 20-02-2007 05:45 PM |
| PHP on windows | louie | Coding Help | 20 | 22-02-2006 06:25 PM |
| ||||
| | ![]() | |||
| | ![]() | |||