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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:06:51+00:00 2026-05-25T06:06:51+00:00

I have the following table structure: Inventory: userid – a – b – c

  • 0

I have the following table structure:

Inventory: userid - a - b - c - d - e - f - g - h - i - j - k

The letters represent an inventory’s slots. Here are stored products‘ ids. These products’ data are also stored in a table called Products. The values in Inventory are linked to the id of the item in Products

A user wants to throw a product from his inventory, clicks a button and using ajax the id of the item is sent to the server.

How can I find and set to NULL the cell containing that product if I have no information other information than the id?

P.S. I am using Symfony framework, if this makes the things easier.

  • 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-25T06:06:51+00:00Added an answer on May 25, 2026 at 6:06 am

    Not the best solution, just an idea:

    UPDATE Inventory SET a = NULL WHERE a = id AND userid=uid;
    UPDATE Inventory SET b = NULL WHERE b = id AND userid=uid;
    ...
    UPDATE Inventory SET k = NULL WHERE k = id AND userid=uid;
    

    This one should work, but I cannot run it to test:

    UPDATE Inventory 
    SET 
     a = CASE WHEN a=id THEN NULL ELSE a END,
     b = CASE WHEN b=id THEN NULL ELSE b END,
     c = CASE WHEN c=id THEN NULL ELSE c END,
     d = CASE WHEN d=id THEN NULL ELSE d END,
     e = CASE WHEN e=id THEN NULL ELSE e END,
     f = CASE WHEN f=id THEN NULL ELSE f END,
     g = CASE WHEN g=id THEN NULL ELSE g END,
     h = CASE WHEN h=id THEN NULL ELSE h END,
     i = CASE WHEN i=id THEN NULL ELSE i END,
     j = CASE WHEN j=id THEN NULL ELSE j END,
     k = CASE WHEN k=id THEN NULL ELSE k END
    WHERE userid=uid;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have the following table structure (in MySQL): DocID, Code, IsDup, DopOf , where
I have the following table structure. A | B | C I wish to
I have the following table structure, which is imported into an Entity Framework project:
I have the following MySQL table structure: num field company phone website 1 Gas
I have no control over database schema and have the following (simplified) table structure:
Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10)
I have the following html structure (which is generated and I can't change): <table
I have already googled for this I have a Table with following structure in

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.