I'm starting on pdo now, so the games will start for me shortly and my doubt is as follows: I am working on another code from a friend and in his code the get to display the information are taken values by id, however I want the information to be searched by another column "code" and I could not make this change, can I to help. The code is as follows:
require 'conexao.php';
// Recebe o id do cliente do cliente via GET
$id_cliente = (isset($_GET['id'])) ? $_GET['id'] : '';
// Valida se existe um id e se ele é numérico
if (!empty($id_cliente) && is_numeric($id_cliente)):
// Captura os dados do cliente solicitado
$conexao = conexao::getInstance();
$sql = 'SELECT id, codigo, nome, cursos, data_inicio, data_termino, horas FROM tab_clientes WHERE id = :id LIMIT 1';
$stm = $conexao->prepare($sql);
$stm->bindValue(':id', $id_cliente);
$stm->execute();
$cliente = $stm->fetch(PDO::FETCH_OBJ);
endif;
in the url it looks like this: link
but should look like this: link
Please help me there.