Jump to content

Thorsverd

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Thorsverd

  1. Thank you kicken for the fast reply! $Florida_Zips is a column name that contains a bunch of zip codes. Trying to achieve this: find business with id in isset. If the Business_Zip is found in Florida_Zips, display image.
  2. Not sure what I am doing wrong. I'm learning 😉 I expect the below code to find one business by id and see if the businesses zip code is found in Florida_Zips column and display the resulting image. It should find one entry, but finds nothing and no errors are being displayed : URL is called like this: website.com/test.php?id=1234&Business_Zip=56789 Thank you very much to anyone kind enough to help me! <?php if (isset($_GET['id'], $_GET['Business_Zip'])) { $con=mysqli_connect("localhost","*****","*****","*****"); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $id = ($_GET['id']); $Florida_Zips = ($_GET['Florida_Zips']); $Business_Zip = ($_GET['Business_Zip']); $result = mysqli_query($con,"SELECT * FROM DATA WHERE '$Business_Zip' LIKE '$Florida_Zips' AND id = " . $_GET['id']); while($row = mysqli_fetch_array($result)) { echo '<br><img src="images/Florida.png" style="padding-bottom:8px;">'; } mysqli_close($con); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.