Search Results

Search found 2 results on 1 pages for 'rockinelle'.

Page 1/1 | 1 

  • I'm trying to build a query to search against a fulltext index in mysql

    - by Rockinelle
    The table's schema is pretty simple. I have a child table that stores a customer's information like address and phone number. The columns are user_id, fieldname, fieldvalue and fieldname. So each row will hold one item like phone number, address or email. This is to allow an unlimited number of each type of information for each customer. The people on the phones need to look up these customers quickly as they call into our call center. I have experimented with using LIKE% and I'm working with a FULLTEXT index now. My queries work, but I want to make them more useful because if someone searches for a telephone area code like 805 that will bring up many people, and then they add the name Bill to narrow it down, '805 Bill'. It will show EVERY customer that has 805 OR Bill. I want it to do AND searches across multiple rows within each customer. Currently I'm using the query below to grab the user_ids and later I do another query to fetch all the details for each user to build their complete record. SELECT DISTINCT `user_id` FROM `user_details` WHERE MATCH (`fieldvalue`) AGAINST ('805 Bill') Again, I want to do the above query against groups of rows that belong to a single user, but those users have to match the search keywords. What should I do?

    Read the article

  • Adding property:value pairs from GooglemapsAPI to an existing json/javascript object

    - by Rockinelle
    I am trying to create a script that finds the closest store/location to a customer using googlemapsAPI. So I've got a json object which is a collection of store objects. Using Jquery's .each to iterate through that object, I am grabbing the driving time from the customer to each store. If it finds the directions, It copies the duration of the drive which is an object with the time in seconds and a human readable value. That appears to work, however when I try to sort through all of those store objects with the drivetime added, I cannot read the object copied from google. If I console.log the whole object, 'closest_store', It shows the values I'm looking for. When I try to read the values directly via closest_store.driveTime, Firebug is outputting undefined in the console. What am I missing here? $.getJSON('<?php echo Url::base() ?>oldservices/get_locations', {}, function(data){ $.each(data, function(index, value) { var end = data[index].address; var request = { origin: start, destination: end, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { //console.log(response); if (status == google.maps.DirectionsStatus.OK) { value.driveTime = response.trips[0].routes[0].duration.value; //console.log(response.trips[0].routes[0].duration.value); }; }); }); var closest_store; $.each(data, function(index, current_store) { if (index == 0) { closest_store = current_store; } else if (current_store.driveTime.value < closest_store.driveTime.value) { closest_store = value }; console.log(current_store.driveTime); } ) });

    Read the article

1