Sorry if this may sound pedantic, but I think the answer to your question goes without saying. I'll write it out anyways.
Imagine this:
Code: Select all
$qry = 'INSERT INTO users VALUES(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10)';
$res = $dbh->prepare($qry)->execute($id, $username, $pw, etc);
When my matching loop kicks in, it'll search for :1 first, and replace it with $id. It matches :1, which is good, but then it will also match :1 with a 0 after it, so it'll match the :1 of :10 and replace that with $id as well. So now the last part reads:
which is obviously undesired, because :10 should be replaced with the 10th argument to execute().
Once again, sorry if this may sounds pedantic. I'm just looking for a way to match only :1, then only :2 and so on.