Question: loop is not working corectly there should be a 1 and a 3 1 code; ; $getRelatedID = 'relatedID _ ' . $rowNum. '

loop is not working corectly there should be a 1 and a 31
code; ";
$getRelatedID='relatedID_'.$rowNum.'';
$RelatedID=$_POST[$getRelatedID];
$database=new database();
$sql = "SELECT * FROM javascripttest.liscence where RelatedID=:ID_"; // Update this query according to your table name
$database->query($sql);
$database->bind(":ID_", $id);
$database->execute();
$rows=$database->object();
foreach ($rows as $key=>$val){
/*$EmployeeFName=$_POST['EmployeeFName'];
$EmployeeLName=$_POST['EmployeeLName'];
$Address=$_POST['Address'];
$Liscence=$_POST['Liscence'];
$LDescription=$_POST['LDescription'];
$Expiration=$_POST['Expiration'];
$Category=$_POST['Category'];
*/
$sql="UPDATE javascripttest.liscence SET
RelatedID=:RelatedID
where id=:id";
$database->query($sql);
$database->bind(":id", $id);
$database->bind(":RelatedID", $RelatedID);
/*$database->bind(":EmployeeFName", $EmployeeFName);
$database->bind(":EmployeeLName", $EmployeeLName);
$database->bind("Address", $Address);
$database->bind("Liscence", $Liscence);
$database->bind("LDescription",$Description);
$database->bind("Expiration",$Expiration);
$database->bind("Category",$Category);
*/
$database->execute();
$rowNum++;
return '[]';
}
?>
 loop is not working corectly there should be a 1 and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!