related to my question : jquery select change event

i need to make search button to above page to search about

if($_POST['search']):
		
			$Duration=$_POST['Duration'];
			$rooms=$_POST['rooms'];
			$Adults=$_POST['Adults'];
			$children=$_POST['children'];
			$agechildren=$_POST['agechildren'];
			$carused=$_POST['carused'];
			$mealplan=$_POST['mealplan'];
			$category=$_POST['category'];
			$date=filter_var($_POST['datepicker'],FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);
			$tab=filter_var($_POST['tab'],FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);

$sql = "SELECT * FROM packages WHERE Trip_Duration LIKE '%Duration%' OR Detailed_Itinerary LIKE '%rooms%' OR Detailed_Itinerary LIKE '%Adults%' OR Detailed_Itinerary LIKE '%Adults%' OR Detailed_Itinerary LIKE '%children%' OR Detailed_Itinerary LIKE '%agechildren%' OR Car_Used LIKE '%carused%' OR meal1 LIKE '%mealplan%' OR meal2 LIKE '%mealplan%' OR meal3 LIKE '%mealplan%' OR meal4 LIKE '%mealplan%' OR meal5 LIKE '%mealplan%' OR HName1 LIKE '%category%' OR HName2 LIKE '%category%' OR HName3 LIKE '%category%' OR HName4 LIKE '%category%' OR HName5 LIKE '%category%' OR Detailed_Itinerary LIKE '%tab%'";	
		

// Prepare the IMG query to be used later on
$imgQuery = "SELECT content FROM packages_image";

// Execute the Packages query
$packages = mysqli_query($sql);

// Loop through the Package results
while ($package = $packages->fetch()): ?>

    <?php
    // Get the image data from the prepared query
    $imgQuery->execute(array($package->package_id));
    $imgData = $imgQuery->fetchColumn();
    ?>

        <div class="col-lg-6 portfolio-item">
            <div class="card h-100">
                <a href="ViewDetails.php?id=<?php echo $package->package_id ?>">
                  <?php  echo '<img src="data:image/jpeg;base64,'.base64_encode($imgData).'" width="100%" height="350px"/>'; ?>
                </a>
                <div class="card-body">
                    <h4 class="card-title">
                        <a href="ViewDetails.php?id=<?php echo $package->package_id ?>"><?php echo $package->package_name ?></a>
                    </h4>
                  <h3 class="breadcrumb" style="color:#C00; text-align:center"><?php echo $package->Package_Price ?> euro.</h3>
                    <p class="card-text"><?php echo substr($package->Detailed_Itinerary, 0, 150) ?></p>
                    <a href="ViewDetails.php?id=<?php echo $package->package_id ?>" class="btn btn-primary">More Details</a>
                </div>
            </div>
        </div>

<?php endwhile; 

endif; 	

Open in new window


i have java code need to repair :

<script>
		$("#Modify").click(function(sea) {
                $.get('search.php',{ search: $(this).val() },function(data) {
					$('#response').html(data);
				});
            });
		</script>

Open in new window

AHMED SAMYownerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Swatantra BhargavaTechnical Specialist/DeveloperCommented:
The code which you have generated inside while loop should be like this:

Make a variable of HTML and your PHP code and echo on Page as output.

$str =  '<div class="col-lg-6 portfolio-item">
            <div class="card h-100">
                <a href="ViewDetails.php?id=<?php echo $package->package_id ?>">
                  <?php  echo '<img src="data:image/jpeg;base64,'.base64_encode($imgData).'" width="100%" height="350px"/>'; ?>
                </a>
                <div class="card-body">
                    <h4 class="card-title">
                        <a href="ViewDetails.php?id=<?php echo $package->package_id ?>"><?php echo $package->package_name ?></a>
                    </h4>
                  <h3 class="breadcrumb" style="color:#C00; text-align:center"><?php echo $package->Package_Price ?> euro.</h3>
                    <p class="card-text"><?php echo substr($package->Detailed_Itinerary, 0, 150) ?></p>
                    <a href="ViewDetails.php?id=<?php echo $package->package_id ?>" class="btn btn-primary">More Details</a>
                </div>
            </div>
        </div>';
echo $str;
Chage like this and try.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.