PDO prepare : create the execute array

HI!

 

Just wondering if there was a way to automatically create the array to be injected in a PDO prepare statement. Perhaps an example to be clearer:

 

$stm = $dbh->prepare("INSERT INTO (a, b, c, d, e) VALUES (:value_A, :value_B, :value_C, :value_D, :value_E)");

Then, when writing:

$stm->execute([

This would auto fill (like the live template) to:

 

$stm->execute([

value_A=>$PLACEHOLDER_1$,

value_B=>$PLACEHOLDER_2$,

value_C=>$PLACEHOLDER_3$,

value_D=>$PLACEHOLDER_4$,

value_E=>$PLACEHOLDER_5$

]);

 

 

Thanks :)

0
1 comment

Unfortunately we're not supporting variables in SQL queries yet.

0

Please sign in to leave a comment.