ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi. i got a task to finish, but i am not sure on how to implement it. the task is:
there is a database of 50 entries (with the option to add/remove entries). those entries will be in three groups ABC. group A will have the first 13, group B the next 13, and group C the rest. i want to have a script that for Monday to Friday will take from group A, one everyday and in serial mode. for weekends it will choose:
Saturday: one from B and one from C
Sunday: one from B and one from C.
any ideas on how to help me on that task?
You may want to add a field to your table that will record the last one selected (or if you wish the next one to be selected)
Throw all of the rows for a given group into an array and search the array for the last one, return the next.
Finally update the table to properly reflect the last selected record.
thanks alot for the reply. the problem is that i am kinda confused with the queries i have to make. how do i differentiate the groups between weekdays and the weekends?
If the database doesn't hold the group information then it can probably be generated by using limit to get the first and last items, I'm not certain of the exact syntax but you should be able to find it in the manual.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.