sql help: delete row where only related to one other row

2008-02-20 Thread douglass_davis
Say I have two tables: table_a -- a_id (primary key) b_id table_b -- b_id (primary key) name there is a one to many mapping between rows in table b and rows in table a. Say I had an Id of a row in table a an (a_id, say 5). Now, what I want to do is delete the row in table_a (ea

mysql query browser

2006-02-13 Thread douglass_davis
I was just running some queries to get an approximate time that they will run, and i saw this in the bottom left corner: 6 rows fetched in 0.0167s (0.4119s) What do the two numbers mean, and why are they so different? I couldn't find this in the help documentation. thanks. -- http://www.do

average numbers, put in another table

2006-01-16 Thread douglass_davis
suppose I have two tables zips zipcode city_id (matches city_id in cities table) latitude longitude cities city_id latitude longitude Say I would like to average all the zipcode lat/lons in each city to get an average latitude and longitude for a city. Then, i would like to put th

Re: Geographical advice

2006-01-13 Thread douglass_davis
Ben Clewett wrote: Hi, I have a need to locate (x,y) coordinates from mysql where they are close to another coordinate. For instance, all pizza bars near my car. Example: Searching for points closer than z to (i,j) using Pythagoras: SET i = 10; SET j = 10; SET z = 30; SELECT x, y FROM

solution for preventing injection attacks

2005-11-17 Thread douglass_davis
I have an idea for preventing sql injection attacks, however it would have to be implemented by the database vendor. Let me know if I am on the right track, this totally off base, or already implemented somewhere... Lets say you could have a format string such as in printf $format=" SELECT %s

fixing messed up permissions

2005-11-02 Thread douglass_davis
I screwed up the permissions on my database. Basically I revoked all the permissions of the root account on the mysql database. To try to fix this, I went through all of the instructions here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html I changed this a little to do

query help

2005-10-11 Thread douglass_davis
lets say i have two tables: module - VARCHAR module_name INTEGER module_id module_config INTEGER module_id VARCHAR config_name VARCHAR config_value config item names and values are rather arbitrary and depend on the module. each module can have zero to many config it

Re: HTML in MySQL?

2005-09-11 Thread douglass_davis
clint lenard wrote: Hi guys, I'm fairly new to MySQL and I've searched for about a week looking for an answer to this... I'm trying to design a Database that would hold HTML sites in the DB itself and use PHP to call for the HTML file - which would be populated with Content from another tabl

Re: ORDER BY distance from a point

2005-08-25 Thread douglass_davis
Scott Gifford wrote: Hello, I'd like to sort my query results based on their distance from a given point. The actual data I have will be in (longitude,latitude) format, but I can convert to something else if that will work better. For example, I may have data like this Item

Re: Treating Two Fields Like One

2005-08-24 Thread douglass_davis
David Blomstrom wrote: --- [EMAIL PROTECTED] wrote: - In my opinion: The easiest thing for you to do right now would be a table like ID (primary key) NAME PARENTID You don't need PARENT, because you have the PARENTID, you can always retrieve parent. Alth

Re: Treating Two Fields Like One

2005-08-23 Thread douglass_davis
David Blomstrom wrote: -- [EMAIL PROTECTED] wrote: Can you just concatenate the two strings together after you get them from the database? e.g. $parent.$name? And, just split() or explode() the string when you get it from the URL? Consider the following URL's: 1. stacks/leo 2

Re: Treating Two Fields Like One

2005-08-23 Thread douglass_davis
David Blomstrom wrote: <>I'm trying to make my first content management system and am wrestling with a problem that seems to be about equal parts PHP, Apache mod_rewrite and MySQL. I wondered if anyone on this list can suggest a MySQL solution - or partial solution. I'm dealing with a single

GIS Applications

2005-08-16 Thread douglass_davis
Is there any one out there using MySql for GIS applications? Any one using the spatial features? Just taking an informal survey. -- http://www.douglassdavis.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PR

Re: spatial extensions - SRID

2005-08-13 Thread douglass_davis
Paul DuBois wrote: At 16:27 -0400 8/12/05, [EMAIL PROTECTED] wrote: This is a big issue. Will this be the same in version 5? Or will the SRIDs actually be used? I would like to just represent everything in lat/lon, not on a planar surface. Now, if the SRIDs are used in MySql 5, whe

Re: Child-Parent Relationships with 2 Parents

2005-08-13 Thread douglass_davis
David Blomstrom wrote: I just thought of a possible solution. Instead of listing all the phyla, orders, classes, families, genera and species in one big table, create separate tables for each taxonomic level. Each taxon would then have two parents. the genus Sus' (pigs) parents would be both

spatial extensions - SRID

2005-08-12 Thread douglass_davis
To the powers that be: Can we get a MySql GIS/spatial list?? This is going to be a very popular area (actually it is already). I am trying to use the Spatial extensions to MySql. To be honest PostGIS has many more features, but MySql is my favorite, and on top of that, the applications I