Answered step by step
Verified Expert Solution
Question
1 Approved Answer
turn this for loop into a foreach loop query ( $sql ) ; $database - > bind ( :ID _ , $id )
turn this for loop into a foreach loop
query$sql;
$databasebind:ID $id;
$databaseexecute;
$rows $databaseobject;
$countablecount$rows;
for $rowNum ; $rowNum $countable; $rowNum
$getID ID $rowNum;
$id $POST$getID;
echo $id ;
$getRelatedID 'relatedID $rowNum;
$RelatedID $POST$getRelatedID;
echo $RelatedID";
$getFName'EmployeeFName$rowNum;
$EmployeeFName$POST$getFName;
echo $EmployeeFName ;
foreach $rows as $key $val
Process data here if needed
For example, update other fields based on $val
$sql "UPDATE javascripttest.liscence SET ID:id RelatedID :RelatedID,
EmployeeFName:EmployeeFName WHERE id :id;
$databasequery$sql;
$databasebind:id $id;
$databasebind:RelatedID", $RelatedID;
$databasebind:EmployeeFName", $EmployeeFName;
$databaseexecute;
EmployeeFName
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started