1

I am new to databases.

I imported a large database using phpmyadmin and it has a FieldA which is a field consisting of grades.

Now what I want to do is have an HTMl form, which takes two inputs min and max for FieldA and computes the average, with the help of an SQL query, of all numbers in FieldA between the min and max.

What is the best way to do this? As in, how can I make my HTML form interact with the database I created on phpmyadmin

Example: I have HTML form with "Max: " and "Min:" User enters: 1000, 100 Clicks submit and the form calls an SQL query that finds all numbers in range of 100,1000 in FieldA of database, and returns their average on HTML screen

Sorry if anything unclear

0

Can you code? If so, I highly recommend PHP, although you can use other languages (PHP is by far the language most often used with MySql)

You might start with GroceryCrud, which is free. It does require some PHP coding, but it is minimal and should be understandable to the average person.

Simple sample from the front page of their website:

$crud = new grocery_CRUD();

// Seriously! This is all the code you need!
$crud->set_table('customers');
$crud->set_subject('Customer');

$output = $crud->render();

That code generates this HTML enter image description here

You can get quite a way with MySql queries, using SQL functions to get minx, max, average – which is all that that you ask for in your question.

e.g SELECT name, grade FROM students WHERE grade > 70 ORDER by grade;

Take a look at the examples or see if you are comfortable with it. They have a good support forum and online documentation .

Please let us know what you think.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.