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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:54:51+00:00 2026-06-15T09:54:51+00:00

(using Coldfusion8/MySQL5.0.88) I’m storing JSON strings in a database. Strings consist of an id

  • 0

(using Coldfusion8/MySQL5.0.88)

I’m storing JSON strings in a database. Strings consist of an id (key) and a number of items in a list (values).

Values look like this:

LOCAL.dropRecall = {"994323":"596895,596871,596864,596888,596840abc,596833,596826","991234":"9999,8888,abced"}

My problem is trying to delete a key/value pair. I’m trying like this:

<cfif  StructKeyExists(LOCAL.dropRecall,"#Session.id#")>
   <cfdump output="e:\dump.txt" label="catch" var="detected">
   <cfset StructDelete( LOCAL.dropRecall,"#Session.id#", "true")>
</cfif>

which correctly detects the key/value pair (detected is reported), but deleting it does not work.

Question:
What am I doing wrong? Why is the key/value pair not removed?

EDIT:
Ok. Found it. I queried the database for field items, set this to LOCAL.dropRecall and wrote items back into the database… so the structDelete worked, but I did not write the empty struct back to the database.

  • 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-15T09:54:52+00:00Added an answer on June 15, 2026 at 9:54 am

    Check that the value of session.id is what you think it is (no extra whitespace or anything like that). I tried a modification if your code on CF8, and it works fine for me:

    <cfset variables.id = 991234>
    <cfset LOCAL.dropRecall = deserializeJson('{"994323":"596895,596871,596864,596888,596840abc,596833,596826","991234":"9999,8888,abced"}')>
    <cfset LOCAL.safeCopy = duplicate(LOCAL.dropRecall)> 
    
    <cfif  StructKeyExists(LOCAL.dropRecall,"#variables.id#")>
        <cfset StructDelete( LOCAL.dropRecall,"#variables.id#", "true")>
    </cfif>
    <cfdump var="#LOCAL#">
    

    Does that code not work for you?

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

Sidebar

Related Questions

I'm storing signatures (using signaturepad in my database Coldfusion/MySQL 5.0.88 and would like to
I'm using Coldfusion. I want to concatenate two strings into the same struct key,
I'm using Coldfusion ORM (Hibernate), and have a cfc mapped to a database table.
Is it possible to paginate and display number of pages in Coldfusion using only
I'm using ColdFusion to return a result set from a SQL database and turn
Last question for tonight, still using Coldfusion8 and MySQL. I have a table with
I have a multi-languages Jquery Mobile site (Backend is Coldfusion8/MySQL). I'm using a generic
I inherited a coldfusion8 site, which is using some search functionality. I'm trying to
I'm trying to setup user authentification in Jquery Mobile/Coldfusion8. I'm using Coldfusion for just
I'm using Coldfusion8 and am stuck trying to call a component. This worked up

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.