I am trying to make a function in my android app that connects to mysql and do the following:
i have two tables in my DB:
CREATE TABLE IF NOT EXISTS `courses` (
`course_id` int(11) NOT NULL,
`course_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
and:
CREATE TABLE IF NOT EXISTS `users` (
`uid` int(11) NOT NULL,
`unique_id` varchar(23) NOT NULL,
`firstname` varchar(50) NOT NULL,
`lastname` varchar(50) NOT NULL,
`dept` varchar(20) NOT NULL,
`email` varchar(100) NOT NULL,
`encrypted_password` varchar(80) NOT NULL,
`salt` varchar(10) NOT NULL,
`created_at` datetime DEFAULT NULL,
`type` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
The idea is the user type = instructor
will add a course and the user type = student
will join the course , many students will join many courses and any course will have many students , now my function is called my courses
is that when the student clicks on it,it will give him a list of all courses that he joined ,so how can i do that in my php
script?
sorry for my bad english :)
thanks in advance