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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:37:12+00:00 2026-06-14T15:37:12+00:00

I am migrating my website from mysql_* methods to mysqli. When I was using

  • 0

I am migrating my website from mysql_* methods to mysqli.

When I was using mysql a data like this:

$variable = <<<eot
    "asdasd" hello 'name name'
    // 
    \\
    "end"   
eot;

Was inserted in Database like follows:

 "asdasd" hello 'name name'
    // 
   \
    "end" 

And it was very OK.

Now it inserts the same data like following:

\"asdasd\" hello \'name name\'\r\n  // \r\n \\\r\n  \"end\"  

Can anyone please tell me how to maintain old way of inserting things into db. I do not need \ and \r and \n and such things I guess. 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-06-14T15:37:14+00:00Added an answer on June 14, 2026 at 3:37 pm

    I can see no difference.

    Table definition:

    create table test (s text)
    

    PHP test source:

    <?php 
    $variable = <<<eot
        "asdasd" hello 'name name'
        // 
        \\
        "end"   
    eot;
    
    // mysql version
    $conn = mysql_connect('localhost', 'USERNAME', 'PASSWORD');
    mysql_select_db('test', $conn);
    $sql = "insert into test values ('" . mysql_escape_string($variable) . "')";
    $result = mysql_query($sql, $conn);
    
    // mysqli version
    $conn = mysqli_connect('localhost', 'USERNAME', 'PASSWORD', 'test');
    $sql = "insert into test values ('" . mysql_escape_string($variable) . "')";
    $result = mysqli_query($conn, $sql);
    
    // mysqli version (prepared statement)
    $conn = new mysqli('localhost', 'USERNAME', 'PASSWORD', 'test');
    $sql = 'insert into test values (?)';
    $sth = $conn->prepare($sql);
    $sth->bind_param('s', $variable);
    $result = $sth->execute();
    

    Every version produces the same entry in the table. So, either this is just a different output you have or your code does something different.

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

Sidebar

Related Questions

We are done migrating a website from old CMS to SDL Tridion. We have
I have a server which already host ASP.Net website. I am migrating from blogger
i am migrating a website from asp to asp.net. i have some asp pages
i am migrating a website from asp.net to asp.net mvc in the asp.net site
I have a website in which I am migrating membership from ASP.NET services to
I've try to migrate a website in Joomla from 1.5 to 2.5 using jUpgrade
I have been migrating a client's website from a Bluehost account to my own
hey again stackoverflowers I'm migrating a website from old ASP (in VBScript) and there's
I'm migrating my library's website from webcal to google calendar. The site is written
I am migrating a website to a drupal CMS. I would like to know

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.