Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About FabioRosa

  • Rank
  1. Hello everyone, A simple function is giving me a headache. Maybe someone can clarify what the problem is: <?php function count_all_stores_by_local_city($loc,$cit){ global $connection; $query = "SELECT COUNT(*) FROM tbl_stores WHERE id_local = {$loc} AND id_city = {$cit}"; $count = mysqli_query($connection,$query); confirm_query($count); return $count; } ?> ... <?php if(isset($_POST['submit'])){ $local = $_POST["local"]; $city = $_POST["city"]; $result_set = find_all_stores_by_local_city($local, $cit); $count = mysqli_fetch_assoc(count_all_stores_by_local_city($local, $city)); ?> <h2>Stores Found: <?php echo $count; ?> </h2> I understand the $count is an object, a print_r gives me the result, but not in the desired format. What to do? It seems something so simple but I think I'm not seeing the point. Thanks in advance!
  • 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.