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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:59:18+00:00 2026-05-27T01:59:18+00:00

I have a Recipe Table: CREATE TABLE IF NOT EXISTS `RECIPES` ( `recipes_id` int(11)

  • 0

I have a Recipe Table:

CREATE TABLE IF NOT EXISTS `RECIPES` (
  `recipes_id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `text` varchar(2000) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `count_persons` int(11) NOT NULL,
  `duration` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `date` datetime NOT NULL,
  `accepted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`recipes_id`),
  KEY `recipes_user_fk` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ;

A insert:

(20, 'Hundefutter', 'Dose öffnen', 4, 10, 1, '2011-12-31 23:59:5', 0)

With php i parse it to a json (getByID):

<?php
header('Content-Type: text/html; charset=utf8');
$id =  $_GET['id'];
include 'db_connect.php';
$arr = array('Data' => null,'Message' => null,'Code' => null);
        if (is_numeric($id))
        {
            //include 'db_connect.php';
            $id =  mysql_real_escape_string($_GET['id']);
            mysql_query("SET NAMES 'utf8'");
            mysql_query("SET CHARACTER SET 'utf8'");
            $sql = "Select * from RECIPES WHERE recipes_id=".$id;
            $result = mysql_query($sql,$db) or exit("QUERY FAILED!");

            while($row = mysql_fetch_array($result))
             {
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['ID'] = $row['recipes_id'];
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['TITLE'] = $row['title'];
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['TEXT'] = utf8_decode($row['text']);
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['COUNT_PERSONS'] = $row['count_persons'];
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['DURATION'] = $row['duration'];
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['USER_ID'] = $row['user_id'];
                 $arr['Data']['Recipes']['Recipe_'.$row['recipes_id']]['DATE'] = $row['date'];
             }
             if(count($arr['Data']['Recipes'])==1)
             {
                $arr['Code'] = 200;

             }
             else
             {
                $arr['Code'] = 404;
                $arr['Message'] = "not found";
             }

        }


        else
        {
                $arr['Code'] = 400;
                $arr['Message'] = "Bad Request";
        }
        mysql_close($db);
        echo json_encode($arr);

?>

My Problem is when i call getRecipeByID.php?=20:

{“Data”:{“Recipes”:{“Recipe_20”:{“ID”:”20″,”TITLE”:”Hundefutter”,”TEXT”:”Dose
\u00f6ffnen”,”COUNT_PERSONS”:”4″,”DURATION”:”10″,”USER_ID”:”1″,”DATE”:”2011-12-31
23:59:59″}}},”Message”:null,”Code”:200}

i get the ‘ö’ as char code.

How to solve this problem?

Thanks

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

    I get the ‘ö’ as char code. How to solve this problem?

    You don’t. \u00f6 is a perfectly legal character escape code in JSON. Once the JSON gets parsed, it will be resolved as an ö.

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

Sidebar

Related Questions

Given this: create table Location( LocationId int identity(1,1) not null primary key, Address nvarchar(max)
Let's pretend I have a large recipe-database. A table for recipes each with an
I have a table with this layout: CREATE TABLE Favorites ( FavoriteId uuid NOT
Each Lucene doc is a recipe, and each of these recipes have ingredients. Im
If I have this statement: ALTER TABLE RecipeBox.Recipe ADD CONSTRAINT AKRecipeBox_Recipe_Name UNIQUE NONCLUSTERED (Name)
I have these relationships: User(uid:integer,uname:varchar) , key is uid Recipe(rid:integer,content:text) , key is rid
I have a database full of recipes, one recipe per row. I need to
I have a base recipe class and I am using a datacontext. I overrode
I have a capistrano deployment recipe I've been using for some time to deploy
I have a rails model that looks something like this: class Recipe < ActiveRecord::Base

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.