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

  • Home
  • SEARCH
  • 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 7769723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:13:42+00:00 2026-06-01T16:13:42+00:00

I have a problem to get in a session array from php into a

  • 0

I have a problem to get in a session array from php into a javascript, I tried to do it with json_encode, but I got problem with that since json not take swedish charatar and I need to have it in the array, any other suggestion how to do it!

I´m setting the sessions array here, the print_r is only for checking so it´s correct

while($row2[]=mysql_fetch_array($result2))
$_SESSION['row2'] = $row2; 
print_r($_SESSION['row2'][0][0]);
print_r($_SESSION['row2'][0][1]);
print_r($_SESSION['row2'][0][2]);

and in my javascript i tried this

var row2 =<?php echo json_encode($_SESSION['row2']) ?>;
console.debug(row2);
  • 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-01T16:13:43+00:00Added an answer on June 1, 2026 at 4:13 pm

    Suggestion: Tell your database-client that you expect the data to be encoded as UTF-8 when you request/fetch it from the database. You do this by setting the client character encoding, see mysql_set_charset­Docs.

    When you retrieve the data encoded as UTF-8 you can use it with json_encode and your website script’s can properly receive it.

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

Sidebar

Related Questions

I have a problem to get in a session array from php into a
i have a problem using some php functions on a string i get from
I have a problem to get to SQL queries into one, the problem is
I have a problem that I'm hoping to get some direction in solving -
I got a problem on google authenticate, it worked for a month but since
so I have following problem. I have a session class that should save it's
I am beginner in ruby + rails. I have problem to get values in
I have a problem to get the values and text of the MultiSelectList to
I am working with MyFaces/Primefaces and I have a problem to get information using
I have a problem wherein I get an AmbiguousMatchException in some of the samples

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.