SA-MP Forums Archive
Need help With Acces Database - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Need help With Acces Database (/showthread.php?tid=335706)



Need help With Acces Database - Phyrunx - 19.04.2012

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 (


Re: Need help With Acces Database - royal_king - 19.04.2012

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.


Re: Need help With Access Database - Phyrunx - 19.04.2012

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


Re: Need help With Acces Database - Mr.Tony - 19.04.2012

what you mean by Datebase ?


Re: Need help With Acces Database - Phyrunx - 19.04.2012

*database


Re: Need help With Acces Database - Calgon - 20.04.2012

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.


Re: Need help With Acces Database - Phyrunx - 20.04.2012

i made the database using Microsoft Access


Re: Need help With Acces Database - Calgon - 20.04.2012

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