JavaScript runs client side and the DB is server side, so that won’t help much. Other scripting languages besides PHP are conceptually possible in WP by executing shell commands from PHP. As a practical matter, it’s difficult to accomplish because many web hosts disable the required shell()
function out of security concerns. For that reason you’re pretty much stuck with WP’s native language, PHP. Depending on your need, there may not be too much PHP involved, the heavy listing is done through mySQL queries. PHP is used to collect user input, execute mySQL, then output the query results.
To access any data within the WP database, I recommend using the global instance of the wpdb class, $wpdb
. It has a number of methods available to execute various sorts of queries. As a global object, it’s already connected to the DB so you don’t have to mess with that aspect. Its methods operate at a slightly higher level than similar PHP functions. It’s optimized to access WP tables, but it’ll work for any table in the DB.
There are many ways to integrate into WP. IMO, the easiest for many things is by building a custom page template, which is kept in a child theme. The one template can collect user input, query the DB, and display the results. What is output can be conditional based on whether the request was GET or POST. A GET request displays the input form, which is POSTed in order to see the query results.
If you’ve experience programming with other languages, you’ll be able to pick up PHP fairly well, despite its obtuse syntax. Not to say it won’t be frustrating at first. What I’d do in your situation is try to find example code that’s close to what you need so you only need to alter it instead of building from scratch. Cobble together the whole from small parts, modifying and filling in as needed to get it all to work as one. Everyone works and learns differently, so a different approach might be more suitable for you.