Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4617312
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:06:24+00:00 2026-05-22T02:06:24+00:00

I have this kind of table in my MySql Database : CREATE TABLE `forum_categories`

  • 0

I have this kind of table in my MySql Database :

CREATE TABLE `forum_categories` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `title` VARCHAR(255) NOT NULL,
    `description` VARCHAR(255) NOT NULL,
    `date` DATETIME NOT NULL,
    PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=DEFAULT

CREATE TABLE `forum_topics` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `category_id` INT(11) UNSIGNED NOT NULL,
    `title` VARCHAR(255) NOT NULL,
    `author` VARCHAR(255) NOT NULL,
    `date` DATETIME NOT NULL,
    `visits` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `sticky` TINYINT(11) UNSIGNED NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=DEFAULT

And I’d like, for example, to remove the category (from the table forum_categories) with id=4.
But, when I do this, I’d like to remove all rows on the table forum_topics with category_id=4.

Is it possible to do a sort of DELETE+JOIN?
Unfortunatly (as you can see) my host provider doesnt support InnoDB (what a shame..), so I can’t use FOREIGN KEYS 🙁

SOLUTION

Solved with :

DELETE forum_categories.*, forum_topics.* , forum_visits.*, forum_messages.*
FROM forum_categories 
JOIN forum_topics ON forum_categories.id=forum_topics.category_id 
JOIN forum_visits ON forum_topics.id=forum_visits.topic
JOIN forum_messages ON forum_topics.id=forum_messages.topic_id
WHERE forum_categories.id=4
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:06:25+00:00Added an answer on May 22, 2026 at 2:06 am

    you can use the multi-table syntax also:

    delete a.*, b.* from forum_categories a inner join forum_topics b on a.id = b.category_id where a.id = 4

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this kind of table on my Database MySql : CREATE TABLE `users`
Given a table named person (in a MySQL database/schema), kind of like this one:
I have this kind of table, it has many rows and each row has
I have a table that looks something like this: CREATE TABLE student_results(id integer, name
I have a mySQL table called clients with this structure: Name | Phone |
we have a form which inserts event data into mysql table, this then feeds
I am trying to create some pages using PHP / MySQL. My database table
I have this kind of question. In my form, i got this as a
I have this kind of node in my xml document: <parent ...> <a .../>
I have this kind of code below, how can I bind the visibility of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.