My basic Problem is to generate a automatised prepared Statement for DB Request
$this->stmt_prep->bind_param("sss", $input[0], $input[1], $input[X]);
There are basically 2 "variables", Ive creating for this Request:
- the Datatype "ssss"
- the Userinput fields as "$Array_as_single_Values"
Assume:
$this->stmt_prep->bind_param("sss", $Array_as_single_Values);
$Array_as_single_Values = "Value1", "Value2", "ValueX"
I read out UserInput as
$Value = Array[$input1=> value1, $input2=> value2, $inputX=> valueX]
How isit possible, to convert each Values of this Array, as variable or its Value
Expected Result:
$Array_as_single_Values [$input1 => "value1";
$input2 => "value2";
$inputX => "valueX";] //how to Convert this to needed Data?
$this->stmt_prep->bind_param("sss", $Array_as_single_Values);
same as:
$this->stmt_prep->bind_param("sss", $input1, $input2, $inputX);
or
$this->stmt_prep->bind_param("sss", "value1", "value2", "valueX");
Purpose: If I have 100 different Input Values, I do not have to re-wirte all statements