$company_id = $_SESSION['compid'];
  $sql="SELECT * FROM `movies` WHERE companyID = ? AND name LIKE '%$search%' OR description LIKE '%$search%' " ;
$stmt=mysqli_stmt_init($conn);
  if (!mysqli_stmt_prepare($stmt,$sql)) {
header("location:main.php?error=stmt failed");
exit();
}
mysqli_stmt_bind_param($stmt,"i", $company_id);
mysqli_stmt_execute($stmt);
$result = $stmt->get_result();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.