PHP or JavaScript function that returns value from database [on hold]

83
July 04, 2018, at 02:30 AM

I have a database of values and want to enable people to search this database.

It should be a simple web page with entry form, you input your string and get back its value.

Term A, Value 11 Term B, Value 22 Term C, Value 33

People enter "A" in the form and the form returns value of A, being "11". For now the database is simple txt file but I can turn it into MySQL database or HTML table.

What is the easiest way to build such a function? Is PHP better for this than JavaScript?

Thanks!

Answer 1

If your values are static (not changing) and you won't have to add a lot you could just build an html table. Then use javascript datatables which will allow your users to search your table without you having to add a lot of code.

Otherwise, its best to use a database. Once your data is in tables you could query the data with SQL, loop through data and build html table, build javascript datatable from html table.

READ ALSO
update query changing value in multiple columns

update query changing value in multiple columns

How can I write a query to change a value in multiple columns where there is a specific value? I want to update a table: look through 40 columns (q1-q40) if the value in that column is -1 then change that to -999 for all rowsDo i still have to list cases for each column...

118
Cant retrieve record from large scale table row

Cant retrieve record from large scale table row

I am using laravel frameworkIn my database records table have more then 400000 row

133
Extend strip_tags to return list of tags being stripped

Extend strip_tags to return list of tags being stripped

We have a custom-built CMS for one of our clients, and are using strip_tags to prevent them from adding unsafe tags to their templates (ie

128
Changing logo on specific language

Changing logo on specific language

I have this multilingual websiteIs there a way I can change the logo to a different logo after I switch to "Arabian?"

117