Jump to content

malkocoglu

Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

0 Neutral

About malkocoglu

  • Rank
    Member
  • Birthday 06/06/1977

Profile Information

  • Gender
    Male
  • Location
    London
  • Age
    35
  1. malkocoglu

    Complicated MYQL Query

    I get it now. Brilliant idea. Thank you guys.....
  2. malkocoglu

    Complicated MYQL Query

    Thank you guys for prompt answer. The difficulty I will have with that is that I say saloon car can take 2 large 1 small which is 3 suitcases. If I allow them to choose 3 suitcases in total then they could choose 3 large suitcase which will not fit in a saloon car. Hope it makes sense...
  3. malkocoglu

    Complicated MYQL Query

    Hello All, I need to figure out a way to get a value from data base. The difficulty is that the query will be based on a form request. I have a table called VEHICLES. And I need to pull all values using the data from submitted form field of passengers, large_bags, small_bags by visitor. This table contains different vehicles like a Saloon car which can take up to 4 passengers, 2 large bags and 1 small bag So Example. If a visitor Selects 2 Passengers, 2 Large Bags and 0 Small Bags. It should only pull the vehicle which can take 2 Passengers, 2 Large Bags. current code I have is like this which only selects a specific value from the table. It does not SELECT * FROM vehicles WHERE passengers ='$passengers' AND large_case='$large_bags' AND small_case='$small_bags' This will only return the value according to what ever the visitor select and because of that 32 Saloon vehicle needs to be created which is not practical. I need to make a code that calculates the option using the values from the form and pulls only the vehicle which is suitable for the entered value Example: We have following vehicles; Salooon => up to 4 Passengers, 2 Large Bags, 1 Small Bag Estate => up to 4 Passengers, 4 Large Bags or 3 Large bags and 2 Small Bag or 2 Large Bags and 4 Small bags or some other combunations MPV => Up to 6 Passengers, 3 Large Bags and 2 Small Bags or other combinations Minibus => Up to 8 Passengers and 10 Large Bags and 5 Small bags or other combinations of large and small bags Form Entry: 3 Passengers + 3 Large Bags + 2 Small Bags This should only Return ESTATE. I hope I could explain enough.
  4. malkocoglu

    UK Post code database

    // First, we need to take their postcode and get the lat/lng pair: $postcode = $_REQUEST['postcode']; // Sanitize their postcode: $search_code = urlencode($postcode); $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $search_code . '&sensor=false'; $json = json_decode(file_get_contents($url)); $lat = $json->results[0]->geometry->location->lat; $lng = $json->results[0]->geometry->location->lng; // Now build the lookup: $address_url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $lat . ',' . $lng . '&sensor=false'; $address_json = json_decode(file_get_contents($address_url)); $address_data = $address_json->results[0]->address_components; $street = str_replace('Dr', 'Drive', $address_data[1]->long_name); $town = $address_data[2]->long_name; $county = $address_data[3]->long_name; $city = $address_data[4]->long_name; $country = $address_data[5]->long_name; $array = array('street' => $street, 'town' => $town, 'city' => $city, 'country' => $country); //echo json_encode($array); echo $array = implode(", ",$array);
  5. malkocoglu

    Free address lookup API based on postcode?

    // First, we need to take their postcode and get the lat/lng pair: $postcode = $_REQUEST['postcode']; // Sanitize their postcode: $search_code = urlencode($postcode); $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $search_code . '&sensor=false'; $json = json_decode(file_get_contents($url)); $lat = $json->results[0]->geometry->location->lat; $lng = $json->results[0]->geometry->location->lng; // Now build the lookup: $address_url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $lat . ',' . $lng . '&sensor=false'; $address_json = json_decode(file_get_contents($address_url)); $address_data = $address_json->results[0]->address_components; $street = str_replace('Dr', 'Drive', $address_data[1]->long_name); $town = $address_data[2]->long_name; $county = $address_data[3]->long_name; $city = $address_data[4]->long_name; $country = $address_data[5]->long_name; $array = array('street' => $street, 'town' => $town, 'city' => $city, 'country' => $country); //echo json_encode($array); echo $array = implode(", ",$array);
×

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.