Results 1 to 2 of 2

Thread: Mysql Query Help

  1. #1
    Moderator Anshul's Avatar
    Join Date
    Jun 2007
    Location
    India
    Posts
    296
    Thanks
    5
    Thanked 19 Times in 15 Posts
    Rep Power
    0

    Default

    <div class='quotetop'>QUOTE </div>
    CREATE TABLE `buddies` (
    `id` int(11) NOT NULL auto_increment,
    `buddy1` int(11) NOT NULL,
    `buddy2` int(11) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=&#39;Buddies table&#39; AUTO_INCREMENT=1 ;


    CREATE TABLE IF NOT EXISTS `users` (
    `id` int(11) NOT NULL auto_increment,
    `login` varchar(30) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `login` (`login`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=&#39;users&#39; AUTO_INCREMENT=1 ;[/b]
    Suppose i have these two tables. in buddies table buddy1 or buddy2 is the ID of users table . I want a query that will delete the buddies ID if buddy1 or buddy2 doesnt not exist in users table

  2. #2
    Moderator Anshul's Avatar
    Join Date
    Jun 2007
    Location
    India
    Posts
    296
    Thanks
    5
    Thanked 19 Times in 15 Posts
    Rep Power
    0

    Default

    close this topic now :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [web] 65 Most Needed Php Scripts
    By jayasanka in forum Scripts Forum
    Replies: 19
    Last Post: 09-11-10, 15:30
  2. How To Protect Funmobile Script From Sql Inject
    By djmal in forum Coding Forum
    Replies: 14
    Last Post: 30-08-10, 10:02
  3. Lavalair Scripts Help (n00b In The Building )
    By doublesix00 in forum Site / Script testing and error fixing
    Replies: 3
    Last Post: 08-02-09, 21:32
  4. Replies: 6
    Last Post: 20-12-08, 19:06
  5. Need Help From All Great Coder
    By tannujain in forum Scripts Forum
    Replies: 13
    Last Post: 13-07-08, 23:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19