linking php with mysql and html
Posted: Thu Aug 28, 2008 8:28 am
Hey,
I’m looking to see if someone will provide me with a bit of starter code, which will enable me to extend it for my personal project. I’m new to php so don’t know that much so a couple of explanations would be helpful too!
I’ve got a basic mysql database that contain the following fields
id Course Grade
1 Computing A
2 sports B
I want to create a form that contains a checkbox for each row (apart from the ID). I’d like it so that the checkboxes interact with the database in a way that is simple to understand so that I can recreate it myself.
So obviously I’d like 2 checkboxes for course and 2 for grade. Then what I need to do is have a submit button that will process a sql query based on the selections made. For example, if the computing and the A box was checked then the command would be SELECT * FROM database WHERE course=’computing’ AND grade=’A’;
The returned value would just need to be the amount of rows selected – I believe a can do that with a SELECT COUNT statement?
All help would greatly be appreciated and would undoubtedly help me to get a better grasp of php.
I’m looking to see if someone will provide me with a bit of starter code, which will enable me to extend it for my personal project. I’m new to php so don’t know that much so a couple of explanations would be helpful too!
I’ve got a basic mysql database that contain the following fields
id Course Grade
1 Computing A
2 sports B
I want to create a form that contains a checkbox for each row (apart from the ID). I’d like it so that the checkboxes interact with the database in a way that is simple to understand so that I can recreate it myself.
So obviously I’d like 2 checkboxes for course and 2 for grade. Then what I need to do is have a submit button that will process a sql query based on the selections made. For example, if the computing and the A box was checked then the command would be SELECT * FROM database WHERE course=’computing’ AND grade=’A’;
The returned value would just need to be the amount of rows selected – I believe a can do that with a SELECT COUNT statement?
All help would greatly be appreciated and would undoubtedly help me to get a better grasp of php.