Hello Guys,
I have the follow problem. I write an sql command but I can only read out the id and not the text areas. For example If I tip in 1,2,4 and look forward the id I will get my results. But I want to tip in 'david' and then i get an error. Only if i write david like 'david' it work.
I am going to post the code.
if (isset($_POST['suchbegriff'])) {
@$anfrage = $_POST["suchbegriff"];
$sql1 = "Select * from daten WHERE ueberschrift=". $anfrage;
$db_erg = $db->query($sql1);
if ( ! $db_erg )
{
die('Ungültige Abfrage: ' . mysqli_error());
}
echo '<table border="0">';
while ($zeile = mysqli_fetch_object( $db_erg))
{
echo "<tr>";
echo "<td>". $zeile->ueberschrift . "</td>";
echo "<td>". $zeile->text . "</td>";
echo "<td>". $zeile->key . "</td>";
echo "</tr>";
}
echo "</table>"; }
?>