Hello again, sorry for all those posts but I'm particularly slow this morning. :rolleyes:
I'm not sure how this may work.
I need to fetch the data from a given query, then use that fetched data to put on session variables.
I'm with something like this right now:
$stmt = $this->_dbh->prepare("
SELECT id_utilizador, nivel_utilizador
WHERE nome_utilizador = ? AND password_utilizador = ? AND estado_utilizador = ?"
$stmt->bindParam(1, $utilizadorVo->getNome(), PDO::PARAM_STR, 255);
$stmt->bindParam(2, $utilizadorVo->getPassword(), PDO::PARAM_STR, 255);
$stmt->bindParam(3, $utilizadorVo->getEstado(), PDO::PARAM_INT, 1);
But this will:
a) prepare the statement;
b) bind parameters;
The execute, according to the documentation, executes the prepared statement, and returns either TRUE or FALSE on success.
This TRUE or FALSE on success means:
a) Return TRUE if the query is executed (even if no records were found) ?
b) Return TRUE if the query is executed and returns records ?
What's the point of doing a select and then do nothing with the returned results? I believe that after this, we need to fetch the data somehow no?
But on the PHP website the examples stop on that (I believe inconsequent) execute();
What am I missing? (besides some sleep hours?)