Need help With Acces Database
#1

i'am making a Database And i want it to randomly Selects 10 students and put them in Room number 1
And then again he selects other 10 Students and put them in room number 2
and then he selects the last 10 students and put them in room number 3

When i Click on a button which is on my website it just randomlly Put students in these Rooms
Can that Be Happend And How can i connect the Database to my website so when i click on the random button it randomlly Puts 10 students in room number 1 10 students in room 2 and the other 10 students in Room number 3

I need it please cause i need it for my School project (
Reply
#2

So it's probably PHP and MySQL work. use PHP rand function to do it, any help contact me via PM i'll help out.
Reply
#3

Can you please Explain More
How about a Step By Step Guide cause i really need it Guys I beg you all Please Tell me how to do it Step By Step
Reply
#4

what you mean by Datebase ?
Reply
#5

*database
Reply
#6

You can't expect us to do your coursework for you...

If you use PHP, then you should familiarize yourself with the ODBC functions in PHP to connect to your Access Database. You won't be using MySQL, since you have an Access database.

You should then make a new field in your table for students, and call it "inside_room" (or something), then you can create a random select query to select 10 rows and set them in to room 1, and repeat the sequence 3 times (you can use the 'WHERE' clause to determine if their room is 0). Make sure you set the room to 0 before you set the class room each time. This is just 1 method I believe might work, it's not the best way to do it surely, but it should work.

Take a look at the following links for guides/tips: (some of these might be MySQL, the syntax is often interchangeable though)
- http://www.roseindia.net/sql/mysql-e...l-random.shtml
- http://www.w3schools.com/sql/default.asp
- http://www.w3schools.com/sql/sql_update.asp
- http://www.tizag.com/phpT/examples/formex.php

If you need any further help, I would advise you visit a forum like codecall - they won't do it all for you, but they'll probably give you a good enough explanation for you to start from.
Reply
#7

i made the database using Microsoft Access
Reply
#8

So? That's what I agreed with...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)