Question 1: is there a good explination online of how to use the JOIN
function in mysql? I've looked at the documentation:
http://www.mysql.com/doc/J/O/JOIN.html
but it's to confusing. It doesn't exactly what you are joining or why you
might want to do that ... I think JOIN is what I need, here is the problem:
So I have some tables:
create table maps
(
rowid INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL
);
create table locations
(
map INT(10), #map rowid
rowid INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL
);
create table notes
(
location INT(10), ## location rowid
rowid INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL
);
Each map has many locations and each location has many notes ...
I want to delete the map, all of it's locations and all of the locations
notes.
clearing the maps and locations is easy:
$sql = "DELETE FROM maps WHERE (rowid='$mapid')";
$result = mysql_query($sql);
$sql = "DELETE FROM locations WHERE (map='$mapid')";
$result = mysql_query($sql);
but how to get rid of those notes?
I'm thinking of sending all of the location rowid(s) to an array then using
that array to delete the notes ... but I think this JOIN thing might let me
do it all with one query.
Can any of you kind folks help me here?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]