I take the example on the Doctrine DBAL online doc:
$queryBuilder
->select('id', 'name')
->from('users')
->where('email = ?')
->setParameter(0, $userInputEmail);
First question:
When I call the:
$sql = $queryBuilder->getSQL();
I expect to have back a complete and valid SQL query with the indicated parameter; unfortunately this is not the case and I have back the query still with question mark; is this normal?
Second question:
It's not clear for me (reading the doc) how to exactly proceed with the query builder to retrieve the result; a practical sample may point me on the right direction.
Similar issue I get with the following:
$DBQB
->insert('core_users')
->values(
array(
'username' => $SETUP['admin']['username'],
'secret' => hash($SETUP['util']['hashalgo'], $SETUP['admin']['passwd'])
)
);
Where the ->GetSQL() don't give me back a valid SQL query:
INSERT INTO core_users (username, secret) VALUES(qsecofr, b7...);
And obviously this lead me to an error.
Thank you for answers.
Note: this is a very similar question of doctrine dbal querybuilder as prepared statement but also the former didn't get an answer...