I have a query that selects based on multiple things. For example, game_name is a string that can be empty if the user so chooses. Is there any way to not do the searching part for game_name if the input is "" but still look for the others?
$stmt = $connection->prepare("SELECT * FROM $config->tablename WHERE id = ? OR game_name = ? OR gamer_tag = ? LIMIT ?");
$stmt->bind_param("ssss", $request->id, $request->game_name, $request->gamer_tag, $request->limit);