Please help really need this code to be searching the database for every possibilities, so if the last name is entered then the first name, address etc should also appear. Thanks here is my code
<?php include "mysqlconnect.php"; $ok=true; try { $dbh = new PDO('mysql:host='.$hostname.';dbname='.$database, $username, $password); } catch (PDOException $e) { $ok = false; echo("Database connection failed, please try again later.If fault persists, Call me "); } $var1 = str_replace(array('%','_'),'',$_POST['var1']); if (!$var1) { exit('Invalid form value: '.$var1); } $query = "SELECT * FROM 'employees' WHERE 'LastName' LIKE :search OR 'fuller' LIKE :search"; $stmt = $dbh->prepare($query); $stmt->bindValue(':search', '%' . $var1 . '%', PDO::PARAM_INT); $stmt->execute(); /* Fetch all of the remaining rows in the result set */ print("Fetch all of the remaining rows in the result set:\n"); $result = $stmt->fetchAll(); foreach( $result as $row ) { echo $row["id"]; echo $row["title"]; } ?>