0
مشکل سرچ در php
سلام
میخاستم سرچ در php رو با pdo انجام بدم ولی با ارور مواجه میشم
<?php
require('includes/config.php');
$keyword = $_GET['key'];
$min_length = 3;
if(mb_strlen($keyword) >= $min_length){
$stmt = $db->prepare("SELECT FROM blog_posts MATCH (postTitle, postDesc, postCont) AGAINST (:key)");
$stmt->execute(array('key' => '%'.$keyword.'%'));
while($row = $stmt->fetchAll(PDO::FETCH_ASSOC)){
echo $row['postTitle'];
echo $row['postDesc'];
echo $row['postCont'];
}
} else {
echo 'Cant find! ';
}
?>
<form role="search" method="get" action="http://localhost:8080/Myblog/search.php">
<div>
<input type="text" placeholder="Search and hit enter..." name="key">
</div>
</form>
ارور
PDOStatement->execute(Array) #1 {main} thrown in C:\xampp\htdocs\Myblog\search.php on line 9