Hello,
I made a search option using php every thing is working ine but when i enter 123 in search it does not pull up my any records is it a problem with my code can anyone help me out
if(isset($_POST['search_now'])){
if(isset($_GET['go'])){
if(preg_match("/^[ a-zA-Z]+/", $_POST['search'])){
$name=$_POST['search'];
$sql ="SELECT * FROM users WHERE company LIKE '%" . $name ."%'";
$result = mysqli_query($connection, $sql);
while ($user_row = mysqli_fetch_assoc($result)) {
$user_id = $user_row["u_id"];
$f_name = $user_row["f_name"];
$l_name = $user_row["l_name"];
$company = $user_row["company"];
$address = $user_row["address"];
$phone = $user_row["phone"];
$fax = $user_row["fax"];
$mobile = $user_row["mobile"];
$email = $user_row["email"];
}
$name = $f_name . " " . $l_name;
} else {
echo "<p>Please enter a search query</p>";
}
}
}