I've searched the internet and found something about using ajax for setting information in my database. I found this page, but it shows how to GET info from your database.
Is it also possible to SET information in the database?
I use this for a schedule.
in my DB I have a table that contains the following columns:
- Startdate
- Enddate
- Productdescription
- Expected production
- actual Production
- Difference
When they create the schedule they only know the first four. The other two need to be filled in automatically. I do this when the production is finished:
I've made a small start about checking if the production is done:
setInterval(function()
{
var currentTime = new Date();
var endProductionTimeMachine1 = <?php echo json_encode($TempomaticRow1[0]['Einddatum']) ?>; // get the enddate from the database via php
var ActualProductionToday = 2100; //just an example value
//Convert mysql date to javascript date
var t = endProductionTimeMachine1.split(/[- :]/);
var endProdTimeMachine1 = new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);
if(currentTime == endProdTimeMachine1)
{
//set information in the DB
}
},1000);
So I would like to know if I can call a php page that inserts information into my database with a parameter from this page.