How to create users like students and professors on MySQL? [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm a newbie with PHP and MySQL. My project is about creating a website online on which I can put my school friend's grades and manage them. The problem is that I don't know how to separate users students/teachers.
I got an idea but still not clear. If in login page a make a radio button and add on it like this: "Student or Teacher". If they choose teacher I must test teacher's accounts to login in them to midify page.

You should look into the user/group/role pattern. You'll enter individuals into groups and assign roles to groups. You'll have to decide if you want one role per individual or many.

Related

Survey of picture choices that drives the next question of picture choices [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I'm trying to create a 3-question survey written in PHP/AJAX/JQuery that will basically present 6 pictures to be ordered/ranked from favorite to least favorite, then submitted & recorded to a mysql db, that will in turn drive the next 6 pictures to be ordered and submitted.
I've tried using a multi-step form, which seems ideal, but all the examples write the recorded choices at the end of the form submission, whereas I need each question in the survey to drive the next set of choices. I can't find anything like that to use as an example.

store users in one table or multiple table Laravel [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 21 hours ago.
Improve this question
we are creating an e-learning website with Laravel, and we have multiple users (student, instructor, admin) should we store them in one table (users) or each user with own table.
I want to know if there is a convention
There is no set in stone rule, it is totally up to you. But from what I see in most Laravel projects, and what I do in my projects as well, to make it easier to read/troubleshoot you use a single "users" table and make a "profile" or "profile_type" column to determine which one are they attached to.

How can I create a list of top donors using php and mysql? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I would like to know how I can create a list of top donors, in which the user who donates the most is in the first position of the list.
In order to donate, you must be logged in
How can I do something like that using php and mysql?
This is only how much i understand your question.
First you need to create table for donors which the storage of their data, and 2nd is to make table for donate which holds the donator.
Then to sort the donator by donated the most, just use COUNT sql query to get the highest donate number.

Matching data in sql and display it through php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to do matchmaking website.
Currently I have two tables which are user profile and their partner profile(which is the requirement that those users hope for). I have to match this two table by using mysql and php. maybe fuzzy logic?
For example, user A hopes for tall partner, then system will match the partner that closes to this user and display on his wall.
But the problem is, i had do many research and still run out of idea of how to do it. Can anyone please help me or give me some advices?Thanks.
Below is what i trying to do but still have no idea.
coding
I think you need one sql:
select * from user
join
partner on
user.user_id = partner.user_id
where
user.email = 'some#email'

Not sure what this is exactly called but, page.php?id=5 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So basically my site is using a mysql db and the id is auto incremented.
So in my db there's
1 Kevin
2 Nick
3 Jon
I want to make it so if a person wants to look at Kevin's profile, the link to it is
site.com/profile.php?id=1
That link would pull up Kevin's profile
The concept you're searching for is called "routing", which is how a URL gets routed to particular content. This concept can be extremely complex (e.g. using a 3rd party routing framework like symfony), or as simple as checking:
$userId = $_GET['id'];
/* some mysqli/pdo/etc. code to grab info on that user */

Categories