Maybe you can help me with this script for F1.0.6.
It is a form submit script that creates a serie of new records.
What it does briefly:
1 it retrieves records from another table (table_13)
2 for each record that is retrieved it creates a new record in 'this' table (table 19)
3 it should copy data from table 13 and from 'this' form into the newly created records in table 19.
This basicly works apart from the indicated in blue: "check_month" is one of the few fields that is in the form from where this script is submitted. So if that field says "10" I want to have that value in all the newly created records (in the "month" field.
It does not recognise $aData['jos_fabrik_formdata_19___check_month']. Do you know why? I also tried to place it outside the 'while'-loop area, but then it is not being recognised either. It should be fairly simple to grab the data from the submitted form, but can't put my finger on it this time.
It is a form submit script that creates a serie of new records.
What it does briefly:
1 it retrieves records from another table (table_13)
2 for each record that is retrieved it creates a new record in 'this' table (table 19)
3 it should copy data from table 13 and from 'this' form into the newly created records in table 19.
Code:
$sql="SELECT * FROM jos_fabrik_formdata_13 WHERE status='approved'";
$csresult=mysql_query($sql);
$num=mysql_num_rows($csresult);
mysql_close();
$i=0;
while ($i < $num) {
$field1=mysql_result($csresult,$i,"bwof_buildingid");
$id=mysql_result($csresult,$i,"fabrik_internal_id");
[color=blue]$month = $aData['jos_fabrik_formdata_19___check_month'];[/color]
$sql="INSERT INTO jos_fabrik_formdata_19 (check_buildingid, cs_join, month) VALUES ('$field1', '$id', [color=blue]'$month'[/color])";
$database->setQuery($sql);
$database->query();
$i++;
}
This basicly works apart from the indicated in blue: "check_month" is one of the few fields that is in the form from where this script is submitted. So if that field says "10" I want to have that value in all the newly created records (in the "month" field.
It does not recognise $aData['jos_fabrik_formdata_19___check_month']. Do you know why? I also tried to place it outside the 'while'-loop area, but then it is not being recognised either. It should be fairly simple to grab the data from the submitted form, but can't put my finger on it this time.