Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 2nd, 2009, 10:51 AM
Registered User
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation linking tables

This is a student web organiser.
I really need help with this!!
Have THREE database tables
COURSEINFO---
Field Type
-----------------------
CourseCode varchar(10)
Semester int(1)
CourseYear int(1)
Day varchar(10)
Time varchar(5)
Subject varchar(100)

WEEKTIMETABLE
---------------
username varchar(10)
day varchar(10)
Time varchar(10)
Subject varchar(100)
CourseCode varchar(10)
Semester int(1)
CourseYear(1)

Userinfo
---------------
firstname varchar(15)
lastname varchar(20)
username varchar(15)
password varchar(20)
email varchar(20)
coursecode varchar(10)
courseyear int(1)

the user enters in all their details at regestration then they login into the system. I have all the seperate courses information in course info. The main aim of the program is to be able to make a unique timetable for each member. I want an php statment that transfers all the course info rows depending on what course and year the user picks during registration. However as there is no username in courseinfo and this is the unique idenitfier for the timetable and is necessary to extract it how will i do this???

not sure at all but something like
select username.userinfo , coursecode.userinfo , courseyear.userinfo , day.courseinfo , time.courseinfo, subject.courseinfo,
from userinfo and courseinfo
where username = (user that just registered) AND courseyear = (course that the user just entered) AND coursecode = (course code that user just entered)

and insert that select statement into the weeklytimetable table

is this possible or is there another way of doing it ?

example of tables
course info
----------
course code-CA316, CA316
semester1, 1
courseyear 1, 1
day MONDAY, TUESDAY
time 09.00, 10.00
subject LECTURE, PARTY

USERINFO
---------
firstname - john, paul
lastname - brown, murphy
username - johnb, paulm
password - ****, ****
email - ifi@fd , ds@fjd
coursecode- ca136, ca136
courseyear - 1, 1

WEEKLYTIMETABLE--
username - johnb, johnb
day -monday, tuesday
time -9.00, 10.00
subject -lecture, party
coursecode - ca316, ca316
semester -1, 1
courseyear -1, 1


many thanks for your help!its very urgent!!
Reply With Quote
  #2 (permalink)  
Old April 3rd, 2009, 05:52 AM
Friend of Wrox
 
Join Date: Oct 2007
Location: , , .
Posts: 130
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to urtrivedi
Default

I think your table design is not normallised. Your weektable contains same columns as you course info table. define primary key in course info and refer that key in weektable.
weektable may look like

username, courseinfoid
__________________
urt

Help yourself by helping someone.
Reply With Quote
  #3 (permalink)  
Old March 4th, 2011, 06:35 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...is that all there is to it?

grstad
__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
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 On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking pivot tables iacon Excel VBA 3 July 24th, 2006 01:25 AM
Access2000 Linking Tables Rchanga Access 1 December 21st, 2004 05:49 PM
Linking Tables usedcarsgbcom Beginning PHP 4 November 23rd, 2004 08:46 PM
Prevent linking to tables MG76 Access 2 March 12th, 2004 02:29 PM
Linking Tables Con Access VBA 2 September 24th, 2003 04:32 PM



All times are GMT -4. The time now is 04:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.