// I am using this to save 1 entry in 1 row of the table ie company name, company address
public void button1_Click(iGUIButton caller){
string output = "'" + textfield2.value + "','" + textarea2.value + "'";
StartCoroutine(PutData("parsecustomerstext.php", output));
}
IEnumerator PutData(string phpDoc, string data){
var form = new WWWForm();
form.AddField( "direction", "put" );
form.AddField("data", data);
WWW www = new WWW("http://funiks.com/invoice/" + phpDoc, form);
yield return www;
Debug.Log(www.text);
}
my php code for this-
if($_POST["direction"] == "put"){
// make sql here
$data = $_POST["data"];
print($data);
$sql = "insert into customers (name,billingaddress1) values ($data)";
print GetData($sql);
}
// Now i want to save multiple entries like
//company name company address
//company name company address
//company name company address
//company name company address
//company name company address
for this i need to do 2 things
-
scrollview which creates input fields on pressing a “add” button, i fill company name, address,and again press the add button if required and so on.
-
save all on pressing the “save” button
Please help me on how to do it for n rows, i am too new to php, please try to keep it simple