For example, I did a search of all the user data in the bank to echo echoes in different columns through the site:
$stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ?");
$stmt->bind_param("s", $usu_codigo);
$stmt->execute();
$usu_info_result = $stmt->get_result();
$usu_info_coluna = $usu_info_result->fetch_assoc();
$stmt->close();
Somewhere else on the site, I wanted to show this result, however, using an ORDER BY or LIMIT, such as:
$stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ? ORDER BY usu_datacadastro DESC LIMIT 5");
How can I do this without having to prepare another query, since I already have the result and just want to filter the output?