I have a complex algorithm, written in C, which I am adding to a php/mySQL site to create a web appication. Currently the algorithm pulls data from a .csv table, does it's work, then outputs the calculated results. Basically, when introducting this into a php/mySQL site, I am struggling to understand the limitations of server-side/client-side language interactions. I do all of my coding in php, never touching C, so I am wondering if this technique will even work. I know that I can exec the C code using PHP. I know I can connect to the mySQL database in C and get my data sets. I am just confused about steps 3/4. Heres what I wan't to happen: 1) Submit the inputs using a html form 2) Run algorithm (written in C) using the submitted inputs and datasets pulled from a mySQL database 3) Generate results within the algorithm 4) Display and save the results to the mySQL database Essentially, I wan't the web app to function as if it is entirely php/mySQL, only the number crunching is done by C code for speed. My first version of the algorithm was written in PHP and everything was gravy, except it took MUCH MUCH longer to generate a solution. Because of this, I had the same algorithm written in Java and C and I am trying to find the best way to impliment it.
PHP can do that easily, I'm not sure how you are getting stuck. You don't need to "exec", just code the formula into a PHP function(s) and off you go. displaying the results is just printing or echo'ing them out. Saving into the database is a core function of php, you just have to decide how you need the tables structured.
I'm sorry, i'm confused. Are you saying to rewrite the algorithm in PHP and not use the C file at all?