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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:06:14+00:00 2026-05-30T10:06:14+00:00

I have joined three tables into a view, and then i try to update

  • 0

I have joined three tables into a view, and then i try to update the view and get this error

#1393 - Can not modify more than one base table through a join view

ER_VIEW_MULTIUPDATE

I understand the error. I cannot update multiple tables at once.

HOWEVER… I have done this before. Last week to be precise, on the same machine, same mysql installation.

I promise you that I have joined together tables through a view before (the same tables infact) and updated the view with no problems.

Does anybody know why its not working?

The PHP code that worked last week

"UPDATE administrators AS a INNER JOIN user_types AS ut ON a.admin_id = ut.type_id INNER JOIN users AS u ON u.user_id = ut.user_id SET a.firstname = '{$user_input["firstname"]}', a.surname = '{$user_input["surname"]}', u.email_address = '{$user_input["email_address"]}' WHERE u.user_id = {$user_input["user_id"]}"

The SQL code im trying now

CREATE VIEW admin_users AS
SELECT administrators ad
    JOIN user_types ut
        ON ad.admin_id = ut.type_reference
    JOIN users us
        ON ut.user_id = us.user_id
WHERE ut.user_type = 'ADMIN'

UPDATE admin_users
SET
    firstname = 'alex2',
    surname = 'finch2',
    email_address = 'test@hotmail.co.uk'
WHERE
    user_id = 2
  • 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-30T10:06:16+00:00Added an answer on May 30, 2026 at 10:06 am

    The SQL that worked last week was a direct UPDATE query that modified tables, whereas you’re now attempting to UPDATE those same tables through a view. That’s the change. With a VIEW, you can only update one table at a time. You might look into stored procedures if you want to update multiple tables with one query.

    Something like this:

    DELIMITER //
    CREATE PROCEDURE updateUser(
        var_user_id INT,
        var_firstname VARCHAR(32),
        var_surname VARCHAR(32),
        var_email_address VARCHAR(128)
    )
    BEGIN
        UPDATE administrators AS a 
            INNER JOIN user_types AS ut 
                ON a.admin_id = ut.type_id 
            INNER JOIN users AS u 
                ON u.user_id = ut.user_id 
            SET a.firstname = var_firstname, 
                a.surname = var_surname, 
                u.email_address = var_email_address 
        WHERE u.user_id = var_user_id;
    END//
    

    To call:

    CALL updateUser( '$user_id', '$firstname', '$surname', '$email_address' );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one Linq to SQL query that simply joins three tables and then
I have two tables that get joined regularly. Table One is about 1 Million
I am building a photo uploading website and I have joined two tables together
I used the mapping solution from this question to have a joined component. But
I have two tables that should be joined together by a foreign key relationship,
I have two tables (Table A, Table B) joined with a join table (TableAB)
say if I have 10 tables. These tables are joined together on different conditions.
I have three MySQL queries I need to combine into a single query using
I have two tables ABC, XYZ, i have taken their join on three common
I have a couple of tables that are joined by GUIDs in SQL Server.

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.