I am fetching some records from database, result of my query returns some values like:
Domain:
Proxy:
Port
Server_Mode:
Now I have a ini file which has these parameters whose value will be empty, So when user edits a file for first time I fetch these records from database and i want to put this according to file parameters.
What I mean is the .ini file will be something like this:
[INIDetails]
SipUserName =
Password =
Domain =
Proxy =
Port =
SipAuthName =
DisplayName =
ServerMode =
Now I want to put the values from database against each parameter. How do I do this?
In my view I Do :
if(empty($file_data))
{
echo form_input($value_param, set_value('$value_param',$pbx_data));
}
else
{
echo form_input($value_param, set_value($value_param, $parameters[$type][$value_param]),'readonly');
}
Now the result of array from my query is:= $pbx_params
And in that array i have domain,proxy,port,server_mode
. HOw to write thier values to file ?
I guess I have to loop through the values from database and check it with .ini parameter if they match then put the value from db of that row