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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:36:41+00:00 2026-06-04T16:36:41+00:00

From php.net reference : The value being encoded. Can be any type except a

  • 0

From php.net reference:

The value being encoded. Can be any type except a resource.
This function only works with UTF-8 encoded data.

However, I use the function like this in one case which works fine:

$result_array = $this->DatabaseObject->_pdoQuery( 'multiple', 'bookmark_model', array( $this->SessionObject->get( 'id' ) ) );
$result_string =  json_encode( $result_array );
$html_string = "<div id='bookmark_data'>" . $result_string . "</div>";
echo $html_string;

But in this case it does not:

$result_array = $this->DatabaseObject->_pdoQuery( 'multiple', 'tweet_model' );
// $tweet_object = new MarkTweet();
$result_string = json_encode( $result_array );
$html_string = "<div id='tweet_data'>" . $result_string . "</div>";
echo $html_string;

In both cases I’m using PDO library to query the database. I know I get back what should be essentially an array of arrays…but I don’t know if this is resource or not…or how it is structured internally.

There is no major difference between the queries that I can see…here they are though. Because the two cases are so similar I don’t know what is causing the fail.

Here are the queries

"bookmark_model" =>         "SELECT * FROM bookmarks WHERE id=? ORDER BY tag, title",

"tweet_model" =>            "SELECT * FROM tweets ORDER BY time DESC LIMIT 7",
  • 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-04T16:36:42+00:00Added an answer on June 4, 2026 at 4:36 pm

    It looks like your _pdoQuery() function returns different types in different situations. You may want to check to make sure you got a successful result before trying to encode it.

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

Sidebar

Related Questions

I got this from php.net website. This is related to the problem I am
Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
Except https://www.php.net/manual/en/book.ktaglib.php and http://getid3.sourceforge.net/ does anyone know of any other way to work from
I am trying to call a php function from .net. I tried to a
Warning: Parameter 3 to showBlogSection() expected to be a reference, value given in /home/smartsta/public_html/includes/Cache/Lite/Function.php
Got it from php.net, but I am not sure is this how everybody destroy
From php.net: <html> <?php /* This will give an error. Note the output *
The goal: To create a .NET dll i can reference from inside SQL Server
I have the following php code from php.net <?php // The i after the
I come into ASP.NET from php so the reason why i ask my question

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.