$param = "%{$name}%";
$stmt = $mysqli->prepare("SELECT topic_id FROM prefix_topic WHERE title LIKE ?");
$stmt->bind_param("s", $param);
$stmt->execute();
$query = "SELECT * FROM `prefix_topic` WHERE `title` LIKE '%$name%'";
$mysqli_query($query);
$stmt->bind_result($topicID);
while ($stmt->fetch()) {
print_r($topicID);
}