php - PDO foreach loop over bindParam with a reference return wrong result -


i think i've read many topics on question still wrong result. have query parameters array want loop foreach() bind parameters.

foreach($aqueryparams $key => &$value){     $stmt->bindparam($key, $value); } 

this concerns insert query , result key inserted in table instead of value. i'm sure key , value , @ place. var_dump() on $key , $value give :firstname $key , samy &$value. :firstname inserted in table...

and tried bindvalue without using reference , it's same result.

to clearer, give link of github repository. can see declaration of parameters array in clientmanager.class.php @ line 44, , foreach() loop bind parameters in dboperation.class.php @ line 97. https://github.com/code-climber/car_rental/blob/preparedstmt/src/car_rental/model/dao/clientmanager.class.php

i'm going mad this.

ok, found wrong. sql query. had put quotes around each values parameters. did not have error message, focused on thing new me, loop on bindparam().

i find moderator bit severe clarity of question because read can on reference...it not duplicate. error elsewhere.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -