Check number of entries before post

D

Dave

Guest
Thank you for writing this interface. We have a small non-profit group with the need to signup for fundraisers. We use this interface to the MySql database for signups.

I have a question though.

Our fundraisers have limited positions. For a given day and shift we can only allow 8 people to signup. How can I restrict this in the post, and in what file would I edit. I'm only now begining to learn PHP.

The database fields in question are: Date, Shift Shift contains (1,2,3 and 4)

example...the user enters their name, then selects the Date they want to work, then the shift. If there are <=8 already, they should not be able to post.

Thank you in advance, any help would be appreciated.
 
E

Eugenio

Guest
Dave wrote:

> Thank you for writing this interface. We have a small
> non-profit group with the need to signup for fundraisers. We
> use this interface to the MySql database for signups.
>
> I have a question though.
>
> Our fundraisers have limited positions. For a given day and
> shift we can only allow 8 people to signup. How can I restrict
> this in the post, and in what file would I edit. I'm only now
> begining to learn PHP.

[....]

You want to limit the number of people that could log-in into DaDaBIK?
You have to create an authentication structur first, it isn't an easy hack.



(Latest version of DaDaBIK when this message was posted: 3.0 beta)
 
E

Eugenio

Guest
Eugenio wrote:

> Dave wrote:
>
> > Thank you for writing this interface. We have a small
> > non-profit group with the need to signup for fundraisers.
> We
> > use this interface to the MySql database for signups.
> >
> > I have a question though.
> >
> > Our fundraisers have limited positions. For a given day
> and
> > shift we can only allow 8 people to signup. How can I
> restrict
> > this in the post, and in what file would I edit. I'm only
> now
> > begining to learn PHP.
>
> [....]
>
> You want to limit the number of people that could log-in into
> DaDaBIK?
> You have to create an authentication structur first, it isn't
> an easy hack.

If you want just to limit the number of entry you could check the number of record before insertint the record in the insert_record function.



(Latest version of DaDaBIK when this message was posted: 3.0 beta)
 
D

Dave

Guest
Eugenio, Thanks. I found the statement below in the Insert_record function. What I don't know is how to equate your variables to the two fields I need to check coming in from the FORM. I assume I would need something like a Select Query on two of the fields not >= 8 and then and if statement around the below entry. I just don't know how to query your variables, Sorry I'm just learning PHP.


$res_insert = execute_db("$sql", $conn);
 
E

Eugenio

Guest
Dave wrote:

> Eugenio, Thanks. I found the statement below in the
> Insert_record function. What I don't know is how to equate
> your variables to the two fields I need to check coming in from
> the FORM. I assume I would need something like a Select Query
> on two of the fields not >= 8 and then and if statement around
> the below entry. I just don't know how to query your
> variables, Sorry I'm just learning PHP.
>
>
> $res_insert = execute_db("$sql", $conn);

You have just to execute a select statement on your table and get the number of rows, check the php manual for further details.



(Latest version of DaDaBIK when this message was posted: 3.0 beta)
 
Top