include $_SERVER['DOCUMENT_ROOT'] . '/includes/db2.inc.php';
//The basic SELECT statement
$select = 'SELECT id, ename,timeupdate';
$FROM = ' FROM product';
$where = ' WHERE TRUE';
$placeholders = array();
$typein = $_GET['product_name'];
$where .= " AND editorid = :editorid AND cname LIKE :cname OR ename LIKE :ename";
$placeholders[':editorid'] = $_SESSION['id'];
$placeholders[':cname'] = '%' . $typein . '%';
$placeholders[':ename'] = '%' . $typein . '%';
try
{
$sql = $select . $from . $where;
$s = $pdo->prepare($sql);
$s->execute($placeholders);
}
catch (PDOException $e)
{
$error = 'error fetching product_name info';
include 'error.html.php';
exit();
}
foreach ($s as $row)
{
$productlist[] = array('id' => $row['id'], 'cname' => $row['cname'], 'ename' => $row['ename'], 'timeupdate' .......
}
the error is :
Can anyone tell me how to solve this problem?