04-06-2017, 09:35 PM
Thanks!
I just went with query() eventually which worked.
The abovePasted code worked just fine until I tried to use the usespice db instance. Doing it the way you showed is probably a good idea. I was using bindParam hoping to conveniently change vars and write multiple rows to my database. Something like.
$fff = 1;
$query->execute();
$fff = 2;
$query->execute();
$fff = 3;
$query->execute();
etc
From what I understand (which isn't much) you get to bind a value only one time then are stuck with it.
Going to give your suggestion a try when I have time.
I just went with query() eventually which worked.
The abovePasted code worked just fine until I tried to use the usespice db instance. Doing it the way you showed is probably a good idea. I was using bindParam hoping to conveniently change vars and write multiple rows to my database. Something like.
$fff = 1;
$query->execute();
$fff = 2;
$query->execute();
$fff = 3;
$query->execute();
etc
From what I understand (which isn't much) you get to bind a value only one time then are stuck with it.
Going to give your suggestion a try when I have time.