« first day (1729 days earlier)      last day (929 days later) » 

9:26 AM
well, now working with angularJs so the "model" data retrieved from a "service", data manipulations / transformations in the "controller" and display in "view"
only part "talking" with db is the "service"
 
 
4 hours later…
1:49 PM
ah, you shouldn't be doing the transformation above client-side at all
as far as grouping a list of persons + contacts into a list of persons who have lists of contacts attached to them, you should do that server-side before you return that data to the client
 
2:46 PM
@TehShrike how should i store geo location coordinates in my database schema, currently I use FLOAT(10,6) but that truncates the coordinates a bit, any better idea or is this the best.
 
FLOAT uses floating points, which will lose precision
You want DECIMAL, which stores the actual digits instead of a floating point number
 
Thanks for your knowledge and suggestions
now time for a debate
evil laugh
if we use DECIMAL what would the length be?
 
3:01 PM
Because ultimately I would like to figure out how to query for locations that are within 2 miles of a certain latitude and longitude
 
3:13 PM
@kabuto178 as much precision as you need.
Decimal degrees (DD) express latitude and longitude geographic coordinates as decimal fractions and are used in many geographic information systems (GIS), web mapping applications such as OpenStreetMap, and GPS devices. Decimal degrees are an alternative to using degrees, minutes, and seconds (DMS). As with latitude and longitude, the values are bounded by ±90° and ±180° respectively. Positive latitudes are north of the equator, negative latitudes are south of the equator. Positive longitudes are east of Prime Meridian, negative longitudes are west of the Prime Meridian. Latitude and longitude...
 
@TehShrike I see, ok I will change my schema to Decimal and give it a try. In the case of querying to find nearby locations however, any advice on that?
 
spatial data :O
oh man
 
 
6 hours later…
9:47 PM
What would the query look like if I just want to return when all 3 columns are empty, not just some?
 
@AmericanSlime it's empty, or FALSE
 
I'm wording this poorly. Return results if some of the 3 columns are empty, but don't return when ALL 3 are empty.
I'm a dumbass and I think I figured this out. I just had to put my ANDs inside parentheses so it would treat it as a group.
SELECT part, user_2, user_3, user_4
FROM quote_lines
WHERE quote_no >= '0003537'
AND (user_2, user_3, user_4) <> '';
The last line in that statement is bad syntax, how does it need to be?
 
@AmericanSlime WHERE a IS NULL AND b IS NULL AND c IS NULL
Or, if you mean "empty string", then WHERE a = '' AND b = '' AND c = ''
@AmericanSlime oh, sorry, sure
WHERE (a = '' + b = '' + c = '') BETWEEN 1 AND 2
since MySQL doesn't have true booleans, just 0 for false and 1 for true, you can use addition to easily find how many matches there were
 

« first day (1729 days earlier)      last day (929 days later) »