Witam,
Próbowałem wiele prób i zero rezultatów, a jak działało , to reszta zniknęła. Podaję kod html z php i tłumaczę o co mi chodzi.
<?php
session_start();
include('db_con.php');
if(isset($_GET['id']) && is_numeric($_GET['id'])){
$id = $_GET['id'];
}else{
die("Error!");
}
$isCheck = $mysqli->query("SELECT * FROM searchapp WHERE id = '$id'");
if($isCheck->num_rows !==1){
die("error");
}
$row = $isCheck->fetch_object();
$sql = "SELECT id, Temat, Opis FROM searchapp WHERE id = ?";
if($query = $mysqli->prepare($sql)){
$query->bind_param('s', $id);
$query->bind_result($id, $Temat, $Opis);
$query->execute();
$query->store_result();
}else{
echo $mysqli->error;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta charset="utf-8">
<meta name="Description" content=" [wstaw tu opis strony] " />
<meta name="Keywords" content=" [wstaw tu slowa kluczowe] " />
<meta name="Author" content=" [dane autora] " />
<title>
<?php echo $Temat;?>
</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class ="tabela_dane">
<table width="600px">
<?php if($query->num_rows !=0):?>
<?php while($query->fetch()):?>
<tr>
<td bgcolor="#00e600"><?php echo $Temat ?></td>
</tr>
<tr>
<td><?php echo $Opis?></td>
</tr>
<?php endwhile;?>
<?php else:?>
<tr>
<td><h2> No Post Founds</h2></td>
</tr>
<?php endif;?>
</table>
</div>
</body>
</html>
Chodzi mi aby wyświetlał się temat w <title></title>
. Jak widzicie, to w tytule mam kod html <font .... itd.>
Próbowałem nowe zapytanie z bind param i działało ale nazwa tematu z opisem na stronie zniknęła.
Jak to mogę napisać?
`dodanie znaczników i ```
- @furious programming