scorpion4377
Programmer
I recently made a site in PHP and MySQL where you can, with a valid code, add a poll with 2-5 choices. Your poll is added automatically, and everybody can vote on it.
I have three tables:
-Codes (Stores valid codes)
-Polls (Stores the questions, information about who added the poll, and the choices)
-Votes (Stores who voted for which choice in which poll)
Everytime somebody tries to add a poll, three MySQL querys are sent.
1. Checks if the code you used is valid
2. It changes the code's structure so it can't be used again
3. Adds the poll
Everytime somebody votes on a poll, the MySQL server has to deal with 3 queries.
Now. Do you think that 3 tables for a project like this is reasonable? What about the amount of queries? Do queries waste a lot of bandwidth? I'm fairly new to MySQL (A month with MySQL, about 7 in PHP)
Thanks.
I have three tables:
-Codes (Stores valid codes)
-Polls (Stores the questions, information about who added the poll, and the choices)
-Votes (Stores who voted for which choice in which poll)
Everytime somebody tries to add a poll, three MySQL querys are sent.
1. Checks if the code you used is valid
2. It changes the code's structure so it can't be used again
3. Adds the poll
Everytime somebody votes on a poll, the MySQL server has to deal with 3 queries.
Now. Do you think that 3 tables for a project like this is reasonable? What about the amount of queries? Do queries waste a lot of bandwidth? I'm fairly new to MySQL (A month with MySQL, about 7 in PHP)
Thanks.