I have a form that submits 2 values to the post target:
$fname=$_POST["fname"];
$lname=$_POST["lname"];
On the target page, I need to search the specified table for matches that are like $fname OR $lname. I'm kind of struggling with the concat part of it.
# $user_info="SELECT * from player_data WHERE firstname like %'$fname'% or lastname like %'$lname'%";
$user_info="SELECT * from player_data where '$fname' like concat(firstname, '%') or '$lname' like concat(lastname, '%')";
$user_data=mysqli_query($con, $user_info);
while ($row = mysqli_fetch_array($user_data,MYSQLI_BOTH))
{
$getfname=$row['firstname'];
$getlname=$row['lastname'];
echo "$getfname $getlname<br>";
}
that first line that's commented, was something I was trying, figured should try to use concat instead.