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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:53:49+00:00 2026-06-16T22:53:49+00:00

i am trying to update a variable row, in a variable table. This is

  • 0

i am trying to update a variable row, in a variable table. This is my query:

// EDIT: removed double…

UPDATE `ec`.`category_id` AS `category_id`,`e`.`title` AS `title`,
    `r`.`first_name` AS `first_name`,
    `r`.`last_name` AS `last_name`,`r`.`email` AS `email`,
    `r`.`comment` AS `comment`,`r`.`amount` AS `amount`,
    `r`.`published` AS `published`,`r`.`transaction_id` AS `transaction_id`,
    `r`.`register_date` AS `register_date`,
max((case `f`.`id` when 1 then `v`.`field_value` else '' end)) AS `pand`,
max((case `f`.`id` when 52 then `v`.`field_value` else '' end)) AS `achternaam`,
max((case `f`.`id` when 53 then `v`.`field_value` else '' end)) AS `voornaam`,
max((case `f`.`id` when 20 then `v`.`field_value` else '' end)) AS `gebdat`,
max((case `f`.`id` when 32 then `v`.`field_value` else '' end)) AS `geslacht`,
max((case `f`.`id` when 31 then `v`.`field_value` else '' end)) AS `kleinkind`,
max((case `f`.`id` when 21 then `v`.`field_value` else '' end)) AS `straat`,
max((case `f`.`id` when 54 then `v`.`field_value` else '' end)) AS `postcode`,
max((case `f`.`id` when 55 then `v`.`field_value` else '' end)) AS `plaats`,
max((case `f`.`id` when 26 then `v`.`field_value` else '' end)) AS `telthuis`,
max((case `f`.`id` when 27 then `v`.`field_value` else '' end)) AS `telmir`,
max((case `f`.`id` when 28 then `v`.`field_value` else '' end)) AS `gsmdeelnemer`,
max((case `f`.`id` when 29 then `v`.`field_value` else '' end)) AS `gsmpapa`,
max((case `f`.`id` when 56 then `v`.`field_value` else '' end)) AS `gsmmama`,
max((case `f`.`id` when 30 then `v`.`field_value` else '' end)) AS `graad`,
max((case `f`.`id` when 88 then `v`.`field_value` else '' end)) AS `bestelling`,
max((case `f`.`id` when 34 then `v`.`field_value` else '' end)) AS `eigendom`,
max((case `f`.`id` when 57 then `v`.`field_value` else '' end)) AS `zodiac`,
max((case `f`.`id` when 42 then `v`.`field_value` else '' end)) AS `tshirt`,
max((case `f`.`id` when 39 then `v`.`field_value` else '' end)) AS `helpdag`,
max((case `f`.`id` when 40 then `v`.`field_value` else '' end)) AS `helpinfo`,
max((case `f`.`id` when 36 then `v`.`field_value` else '' end)) AS `vervoerjanee`,
max((case `f`.`id` when 37 then `v`.`field_value` else '' end)) AS `vervoerinfo`
from ((((`dat_eb_field_values` `v` join `dat_eb_registrants` `r` on((`v`.`registrant_id` = `r`.`id`)))
join `dat_eb_fields` `f` on((`v`.`field_id` = `f`.`id`)))
join `dat_eb_events` `e` on((`r`.`event_id` = `e`.`id`)))
join `dat_eb_event_categories` `ec` on((`ec`.`event_id` = `e`.`id`)))
where ((`ec`.`category_id` = 4) and (`e`.`published` = 1))
SET $rowname=$newvalue WHERE transaction_id=$transid

Normally this query uses SELECT as the first argument instead of UPDATE.
The last line was also added by me.
$rowname, $newvalue and $transid are all defined and it geives me the following error:

Not unique table/alias: 'first_name'.

Thanks in advance, Laurent

  • 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-06-16T22:53:50+00:00Added an answer on June 16, 2026 at 10:53 pm

    The syntax for UPDATE clause is something like this

    UPDATE table JOIN table1 ON table.field = table1.field SET table.field2 = 'value' WHERE table.field3 = 'value2'
    

    You don’t provide any fields to select as UPDATE clause does not select anything. So, you should remove the fields from SELECT clause and add the WHERE pats after SET.

    UPDATE 
    ((((`dat_eb_field_values` `v` join `dat_eb_registrants` `r` on((`v`.`registrant_id` = `r`.`id`)))
    join `dat_eb_fields` `f` on((`v`.`field_id` = `f`.`id`)))
    join `dat_eb_events` `e` on((`r`.`event_id` = `e`.`id`)))
    join `dat_eb_event_categories` `ec` on((`ec`.`event_id` = `e`.`id`)))
    
    SET $rowname=$newvalue
    
    WHERE ((`ec`.`category_id` = 4) and (`e`.`published` = 1)) AND transaction_id=$transid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i was trying to update a table row by row in postgresql using python.
I am trying to update a column in a row in a MySQL table.
I am trying to update customers information using a mysql query. The variables have
I am trying update text views while this loop is processing. Here is my
Im trying to update a table with the following code. If I change WHERE
I am trying to execute two sql statements in a row. EDIT:Only the first
I am trying to update a row with SQL, but I want to be
I'm trying to use a variable as the table name within a stored procedure
I'm trying to update a table with the multiple returns of a function. I
I have a table that looks something like this: <table> <tr id=header> <th>Title</th> <th>Title</th>

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.