use value from time field in query ONload

Hi There,

I have a Query on the ONload of a form.

This query checks if a user is allready signed in on a time slot

///

// SQL statement parameters
$check_table = ‘ILP_ev_wk_ronde_st’; // Table name
$check_where = “ev_id = [ev_id] AND start_tijd = ‘.[start_tijd].’ AND st_id = [usr_st_id]”; // Where clause

///

but somehow this works perfect if the slot is a number, but with a field on time it just ignores (read: the time echo’s right, but does’nt do anything)

so the idea is that scriptcase checks if that time is allready in the database for that user (usr_st_id) on that event (ev_id)

any suggestions. i know that this works when i chabge the time field with an integer field.

Hi,
to get an idea of the connection time, why not create an integer field, and use strtotime by comparison so you can compare by simply using simpler formulas, you convert back to date time if you had to display it in hours, ( ref: https://www.php.net/manual/en/function.strtotime.php)

ok thx! i’ll give it a try. is it necessary to make a new field to store this value or is a string or var enough?

for me it is not necessary, convert it and try as a var,