Hey! This code is giving me a 500 error in php.
<?php
$con = new PDO("mysql:host=localhost;dbname=img",'redacted','redacted');
if (isset($_POST["submit"])) {
$str = $_POST["search"];
$sth = $con->prepare("SELECT * FROM `searchv2` WHERE Name = '$str'");
$sth->setFetchMode(PDO:: FETCH_OBJ);
$sth -> execute();
$path = $row->Path;
if($row = $sth->fetch())
{
echo "<br><br><br>";
echo "<a href='https://riverside.rocks/${path}'>";
echo ' <div class="siimple-box">';
echo '<div class="siimple-box-title">${row->Name}</div>';
echo ' <div class="siimple-box-detail">${row->Description}</div>';
echo "</div>";
echo "</a>";
}
else{
echo "No results. Maybe try another search?";
}
}else{
echo "Please enter a search term.";
}
?>
Any idea what is wrong? I ran this through a few online checkers and nothing seemed to be wrong.