Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I'd have the system read the current system date automatically. Stops the 'volunteers' fiddling the dates
They can't fiddle with the dates. I'm not explaining very well based on the last two posts. I used win32sux script from post #7 so that when a volunteer logs in by name, a unix timestamp is automatically posted in the mysql table. I wasn't aware that something like win32sux last suggestion was a possibility so I will do some research on that.
Quote:
automatically setting the time to midnight in the timestamp generated from your search form's input, and then telling MySQL to only show you records with timestamps between "that" and "that plus 86400"
I then added another row to the table for yearmonth. When volunteers login they are asked to enter the date. This is not used to determine hours but only for search purposes and is not an output in the scripts. It's a little cumbersome but, until I am able to implement win32sux suggestion, I guess this will work.
Yeah, I'd recommend you start working to completely rid yourself of any non-timestamp storage in your database. That thing about having the guys enter dates on their own in order to use that for search later sounds really unnecessary, error-prone, and cumbersome IMHO. If you need help implementing the suggestion I gave you about "midnight" just ask.
Last edited by win32sux; 10-01-2008 at 04:52 PM.
Reason: Removed request to change certain CODE tags to QUOTE.
I agree that having non-timestamp storage is obviously duplicative and a little cumbersome. I tried it on a test machine to see if it would output the data I wanted the way I wanted and it did.
I do need help implement your suggestion about a "midnight" entry. I understand the concept but am not sure how to implement it. I did a little googling earlier but haven't found anything satisfactory yet. Will keep trying and I would appreciate any help.
I've obviously got something wrong in the script. Database name 'timesheet', table 'hours', two fields 'name' and 'datetime'. Here's the php script I have:
I understand how the part of the script you posted in your last post would work but don't see how the script could work. Something missing and I don't know what it is. I'm a little out of my depth here.
Variable names are case-sensitive. The values you are feeding the mktime() function in your post above aren't the ones which were submitted via POST. Once you fix that you should verify that your form is submitting the POST values properly (you can test by echoing them on the search result page) before focusing on the query part.
OK. Got it working. Thanks for your help. The entry below was part of a different search script I use when I was trying different things to get this to work, forgot to delete.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.