sclarkmc
10-27-02, 09:34 PM
I need some help. I have been trying to do this for like 2 weeks and I just cannot come up with a solution. Can anyone offer a suggestion of how I can proceed with this.
My MYSQL table structure is this:
idnum int(10) NOT NULL auto_increment,
day char(3) default NULL,
time varchar(15) default NULL,
section char(2) default NULL,
instructor varchar(30) default '0',
offsite char(1) default 'N',
server int(1) default '0',
courseid varchar(40) default NULL,
station char(3) default NULL,
dayorder tinyint(1) default '0',
semesterid int(10) default NULL,
visible char(1) default 'N',
PRIMARY KEY (idnum,idnum),
UNIQUE KEY idnum (idnum),
KEY idnum_2 (idnum)
I am running the following SQL statement with PHP
Select * from tablename where day=dayname order by courseid;
(there is nothing wrong with the sql it runs fine i just substituted names where the values usually go)
So here's what it is currently doing, it is being output in a table like so this is based on the courseid field:
A B
C D
E F
Which is fine, it outputs the data wonderfully, however I would really like it to appear in this order also based on the courseid field:
A D
B E
C F
I cannot think of way to do this and I've been trying for about 2 weeks.
The problem comes in here. I'm need to use a majority of the fields in the output. It is used to build a table of links to various areas. The server, and courseid make up the link, where a substring of courseid makes up the link text along with the instructor field. The time and offsite fields also determine if additional data shows up next to the link (just an * and the time if it is not a certain time) Anway, I can do all the printing of the different variables, I just need access to all the data of a row
I have thought about using IDNUM, however in this case some of the number are 1 then 200 it just depends on when the class was added. Plus I really don't want this to be handled by the database.
I have probably confused the heck out of some people, however any help you can provide would be most appreciated.
Thanks,
Sean Clark-McCarthy
My MYSQL table structure is this:
idnum int(10) NOT NULL auto_increment,
day char(3) default NULL,
time varchar(15) default NULL,
section char(2) default NULL,
instructor varchar(30) default '0',
offsite char(1) default 'N',
server int(1) default '0',
courseid varchar(40) default NULL,
station char(3) default NULL,
dayorder tinyint(1) default '0',
semesterid int(10) default NULL,
visible char(1) default 'N',
PRIMARY KEY (idnum,idnum),
UNIQUE KEY idnum (idnum),
KEY idnum_2 (idnum)
I am running the following SQL statement with PHP
Select * from tablename where day=dayname order by courseid;
(there is nothing wrong with the sql it runs fine i just substituted names where the values usually go)
So here's what it is currently doing, it is being output in a table like so this is based on the courseid field:
A B
C D
E F
Which is fine, it outputs the data wonderfully, however I would really like it to appear in this order also based on the courseid field:
A D
B E
C F
I cannot think of way to do this and I've been trying for about 2 weeks.
The problem comes in here. I'm need to use a majority of the fields in the output. It is used to build a table of links to various areas. The server, and courseid make up the link, where a substring of courseid makes up the link text along with the instructor field. The time and offsite fields also determine if additional data shows up next to the link (just an * and the time if it is not a certain time) Anway, I can do all the printing of the different variables, I just need access to all the data of a row
I have thought about using IDNUM, however in this case some of the number are 1 then 200 it just depends on when the class was added. Plus I really don't want this to be handled by the database.
I have probably confused the heck out of some people, however any help you can provide would be most appreciated.
Thanks,
Sean Clark-McCarthy