2
Good afternoon, I’m trying to leave each page with a different title based on the id. I have to say that I am very beginner in the area and probably not a big deal, my code is like this:
<?php
include 'conta/config.php';
$codigo = $_GET["id"];
//echo $id;
//exit;
$titulo = "SELECT titulo FROM tbl_criticas WHERE id = $codigo;";
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>
<?php echo $titulo; ?>
</title>
In the title it returns "SELECT title FROM tbl_criticas WHERE id = 34;". But I would like you to return the title of product 34, someone gives me a strength here ?
This is not enough to extract the result of the database, ie lacked the connection code and query.
– rray
And how would it look ?
– Caiera
You can see some examples, PDO or Mysqli
– rray