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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:24:09+00:00 2026-05-24T01:24:09+00:00

I have values I’ve added to my session that I’d like to pass into

  • 0

I have values I’ve added to my session that I’d like to pass into an query as follows:

$eventTypeID = $this->session->userdata('eventtypeID');
$this->session->unset_userdata('eventtypeID');
$venueCityID = $this->session->userdata('venuecityID');
$this->session->unset_userdata('venuecityID');
echo json_encode($this->event_model->getSearchEvents($eventTypeID, $venueCityID));

The issue I’m running into is that last line (echo json_encode…) will not run when the prior variables are extracted/unset. If I comment out the variables, and run simply:

echo json_encode($this->event_model->getSearchEventsAll());

Then all works well. Can someone tell my why json_encode doesn’t seem to play well with sessions and how I may be able to get this to work? Thanks!

EDITED

After much frustration, it now appears the issue may not be with the session, but is instead with outputting my query:

$this->db->_compile_select();     
$q = $this->db->get();
echo $this->db->last_query();  

All used to work fine, and I was able to “intercept” the query to see what was being called, but now when using _compile & last_query, nothing happens????

  • 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-24T01:24:09+00:00Added an answer on May 24, 2026 at 1:24 am

    Run json_last_error() to see if any errors were encountered encoding the data. See the example on the docs page for proper usage:

    http://www.php.net/manual/en/function.json-last-error.php

    We’re not certain what $this->event_model->getSearchEvents($eventTypeID, $venueCityID) returns VS $this->event_model->getSearchEvents(), but there should definitely not be any problems related to the use of variables.

    As always, try var_dump() on the output (try before decoding) and see what the differences are between the two return values of the function. You might even be encountering an error within the function itself that’s stopping execution – make sure error_reporting() is on full-blast.

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

Sidebar

Related Questions

I have this query to fetch the total OrderStatus that have values 1 and
I have a nvarchar column that have values like '21:15:00 monday 1390/09/10 morning' I
I have values returned by unknown function like for example # this is an
I have values like this in my column: /1/0/101.00_1234.jpg Now I want to replace
I have values like this in my amount column 323547.23700 12345643.34222 I want to
I have values in a resx file that I would like to output in
so we have values generator that outputs someting like FF00FF5F . We have some
i have a session variable -${reData.totalCharge} it may have values like 000000033 . when
I have a query that needs to check that all fields have values are
I have values like this: aaa_1, bb_5, c_21, a_b. Now i need remove trailing

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.