Spectre Posted May 4, 2008 Share Posted May 4, 2008 Ok I've got two tables, one keeps rows of info for one thing, the other keeps info for another section, but part of it holds info of the placement in an explore code of the aforementioned table... (sorry if this is confusing) Basically... I want to run a query in phpmyadmin rather than have to write a script for this... clans table keeps info for clans, name, id, member amount, leader, it's contents etc.... countryside table for keeping certain parts of an explore code of a 80x80 grid, so like x shop xco yco, and if you visit those coords, that link "x shop" is there. also in the countryside table is the listing for a clans castle postion in the countryside area what i want to do is to basically delete the rows for clans that no longer exist, so the castle links disappear until taken again by a new clan so I want to select the the id field from ALL the rows of the clans table, and then delete from countryside table all those that arent part of the first result so basically delete from countryside where clanid != now the part that comes next is what I'm not sure of, I want it to then do another query mysql_fetch_assoc(mysql_query("select id from clans")) so delete from countryside where clanid !=mysql_fetch_assoc(mysql_query("select id from clans")) now I'm not sure that'll work, or if there's another way etc, hence asking here for some advice (this is something I'll put into the SQL window of phpmyadmin) Quote Link to comment Share on other sites More sharing options...
Spectre Posted May 4, 2008 Author Share Posted May 4, 2008 Ok NVM close this, done it via php now as a periodical update in a cron job. Sorry to waste time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.