Fin Vangelis
asked on
php ajax html dynamic record handling
I have an html form.
I have the following php script.
The saveVisit function below is one record.
I could have 1 or up to 6 records.
I am executing php with ajax.
How do I create the html form fields to allow for easy handling of dynamic records?
Also the same applies for my php to allow for dynamically handling record in server.
I have the following php script.
The saveVisit function below is one record.
I could have 1 or up to 6 records.
I am executing php with ajax.
How do I create the html form fields to allow for easy handling of dynamic records?
Also the same applies for my php to allow for dynamically handling record in server.
function processEachVisit(){
//loop through each visit
//execute saveVisit query
};
//function to save each visit.
function saveVisit($dbconn, $providerID, $clientId, $visitStart, $visitEnd, $visitUnits, $visitMinutes, $visitActvities, $visitComments){
$Query = 'INSERT INTO serviceRendered (clientId, visitStart, visitEnd) VALUES
( $1, $2, $3 ) RETURNING id';
$result = pg_query_params($dbconn, $Query, array(clientId, visitStart, visitEnd));
$row = pg_fetch_row($result);
return $row['0'];
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks this is what I needed.
ASKER