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 7583367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:39:38+00:00 2026-05-30T18:39:38+00:00

These two PHP MySQL queries work. mysql_query(DELETE FROM videos WHERE id=’10’;); mysql_query(DELETE FROM comments

  • 0

These two PHP MySQL queries work.

mysql_query("DELETE FROM videos WHERE id='10';");
mysql_query("DELETE FROM comments WHERE videoId='10';");

This single query fails due to a MySQL syntax error pertinent to the latter DELETE operation.

mysql_query("DELETE FROM videos WHERE id='10';DELETE FROM comments WHERE videoId='10';");

I’ve stared hard and can’t see the syntax error. What is it?

  • 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-30T18:39:39+00:00Added an answer on May 30, 2026 at 6:39 pm

    You cannot execute multiple queries with mysql_query. If you really want to (security risk!), use mysql_multi_query. (And you should use the newer mysqli_* functions). It’s a good idea two embed those two calls in a transaction.

    But this looks a lot like you really want to define foreign key constraints. I highly recommend them, if you are already using InnoDB.

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

Sidebar

Related Questions

I am just begining php and mysql. I have two queries from my database.
I have two MySQL queries in my PHP code. Basically I need the two
Are there any PHP equivalents for these two functions? I tried searching but couldn't
Suppose there are two scripts Requester.php and Provider.php, and Requester requires processing from Provider
These two querys gives me the exact same result: select * from topics where
I have a php page that pulls data from a mysql database based on
<?php $results = mysql_query(SELECT * FROM .TBL_SUB_RESULTS. WHERE user_submitted != '$_SESSION[username]' AND home_user =
I have a webapp written in PHP using a MySQL database backend. This question
I have these two SQL queries at the top of every page on my
I am developing a personal PHP/MySQL app, and I came across this particular scenario

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.