Jump to content

[SOLVED] Need a lil help


Spectre

Recommended Posts

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)

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.