Sorry, to be more clear, something like this:
$stmt1 = $db->prepare("UPDATE table1 SET col1 = :a WHERE col2 = :b;");
$stmt1->bindParam(':a',$a);
$stmt1->bindParam(':b',$b);
$stmt2 = $db->prepare("INSERT INTO table1(col1) VALUES(:c);");
$stmt2->bindParam(':c',$c);
while($someCondition) {
$a = $someValue;
$b = $otherValue;
$stmt1->execute();
if($otherCondition) {
$c = $yetAnotherValue;
$stmt2->execute();
}
}
I tried to build an example like this, but it failed on the bindParam() call for the second statement with "Fatal error: call to member function bindParam() on a non-object."