Reputation: 947 Master
- Active Posts:
- 2,360 (1.8 per day)
- 15-February 11
- Profile Views:
- Last Active:
- Aug 05 2014 03:17 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Dream Kudos:
- Expert In:
Posts I've Made
Posted 5 Aug 2014Hello there,
You should use a UNIQUE constraint and apply it on your DATETIME field. This would require you to alter the table. This works but practically I won't suggest you do. The best option is to check it manually. I don't believe appointments are going to be a minute long and the UNIQUE constraint would only account for that specific time. Plus using the UNIQUE constraint would mean that you would have to delete your appointments after they're finished in case someone else wants to book that time in the future. In my opinion your best bet would be to check it manually. An appointment or booking should have an end time also.
I haven't used MySQL in a while so forgive me if there's an error here but this is the logic
IF (SELECT 1=0 FROM YourTable WHERE `appointment_starttime` >= requested_time AND `appointment_endtime` < requested_time) THEN BEGIN INSERT INTO YourTable .................. END
This is of course a simple solution because remember bookings can overlap. It's rare you're going to have someone book the exact same time down the minute all the time. For instance someone's booking can't end in the middle of another person's booking. Nonetheless you see that you can perform IF THEN ELSE queries with MySQL.
Posted 5 Aug 2014Hello there,
This is because an implicit cast isn't being performed. You'll have to do the cast manually. Check out the Convert.ToDouble method. It has many other overloaded methods that you can use to do many conversions. Play around with the Convert class too.
The other alternative which will make your code run a lot cleaner is the Double.TryParse method. It returns a Boolean that states whether or not the conversion was done so that you can basically perform error checking.
Also don't forget to use
Posted 26 Feb 2014Well technically there's a redirect directly after your echo. Remember all PHP code is ran before anything even reaches the client/browser. Therefore PHP would have already executed the redirect thus not displaying the echo statement you have there.
Try removing the header('location ....') line to confirm that rows are actually being deleted OR pass the number of rows being deleted as a GET request to the page you're redirecting to.
header('location: index.php?result=' . $delete->affected_rows);
Posted 26 Feb 2014Where are the other delegates? So far I don't see a delegate that accepts a string and returns a string in ConsoleAPI.cs. If there isn't one then that's your problem right there.
public delegate string <DelegateName>(string str);
Posted 26 Feb 2014Create a handler for the KeyPress event and then check which key was pressed within the e.KeyChar (don't quote me on the variable here, all from memory). If the KeyChar is not allowed then change e.Handled to true. This will ensure that the key is not processed.
You can also set the same handler for all of your 81 text boxes' KeyPress event.
- Member Title:
- Changed Man With Different Priorities
- 23 years old
- February 13, 1991
- Years Programming:
- Programming Languages:
- Website URL: