Data is getting changed while inserting php












0














I have a word for example "A'Bc" it will be inserted into MySQL and displayed as "A’Bc" upon retrieving how to solve this problem?



Thanks for your help in advance.



$dbs = "INSERT INTO all_asins_task_data (Locale, Task, vendor_name, vendor_code, ASIN, Action, Content, updated_on, user_id, Parent_ASIN, tt_id, value, service, comment, Allocation_type, Week_Number, month, Year) 
VALUES ('".$d1."', '".$d2."', '".$d3."', '".$d4."', '".$d5."', '".$d6."', '".$d7."', '".$r."','".$_SESSION['login_user']."', '".$d8."', '".$d9."', '".$d10."','".$d11."', '".$d12."','".$d13."','".$d14."','".$monthName."','".$year."')";
$run = mysql_query($dbs);









share|improve this question
























  • What's your retrieving mechanism? your own PHP script?
    – Marc Delisle
    Dec 29 '18 at 23:22










  • Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
    – Micheal
    Jan 4 at 12:40












  • Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
    – Micheal
    Jan 4 at 12:44










  • I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
    – Micheal
    Jan 4 at 15:34
















0














I have a word for example "A'Bc" it will be inserted into MySQL and displayed as "A’Bc" upon retrieving how to solve this problem?



Thanks for your help in advance.



$dbs = "INSERT INTO all_asins_task_data (Locale, Task, vendor_name, vendor_code, ASIN, Action, Content, updated_on, user_id, Parent_ASIN, tt_id, value, service, comment, Allocation_type, Week_Number, month, Year) 
VALUES ('".$d1."', '".$d2."', '".$d3."', '".$d4."', '".$d5."', '".$d6."', '".$d7."', '".$r."','".$_SESSION['login_user']."', '".$d8."', '".$d9."', '".$d10."','".$d11."', '".$d12."','".$d13."','".$d14."','".$monthName."','".$year."')";
$run = mysql_query($dbs);









share|improve this question
























  • What's your retrieving mechanism? your own PHP script?
    – Marc Delisle
    Dec 29 '18 at 23:22










  • Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
    – Micheal
    Jan 4 at 12:40












  • Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
    – Micheal
    Jan 4 at 12:44










  • I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
    – Micheal
    Jan 4 at 15:34














0












0








0







I have a word for example "A'Bc" it will be inserted into MySQL and displayed as "A’Bc" upon retrieving how to solve this problem?



Thanks for your help in advance.



$dbs = "INSERT INTO all_asins_task_data (Locale, Task, vendor_name, vendor_code, ASIN, Action, Content, updated_on, user_id, Parent_ASIN, tt_id, value, service, comment, Allocation_type, Week_Number, month, Year) 
VALUES ('".$d1."', '".$d2."', '".$d3."', '".$d4."', '".$d5."', '".$d6."', '".$d7."', '".$r."','".$_SESSION['login_user']."', '".$d8."', '".$d9."', '".$d10."','".$d11."', '".$d12."','".$d13."','".$d14."','".$monthName."','".$year."')";
$run = mysql_query($dbs);









share|improve this question















I have a word for example "A'Bc" it will be inserted into MySQL and displayed as "A’Bc" upon retrieving how to solve this problem?



Thanks for your help in advance.



$dbs = "INSERT INTO all_asins_task_data (Locale, Task, vendor_name, vendor_code, ASIN, Action, Content, updated_on, user_id, Parent_ASIN, tt_id, value, service, comment, Allocation_type, Week_Number, month, Year) 
VALUES ('".$d1."', '".$d2."', '".$d3."', '".$d4."', '".$d5."', '".$d6."', '".$d7."', '".$r."','".$_SESSION['login_user']."', '".$d8."', '".$d9."', '".$d10."','".$d11."', '".$d12."','".$d13."','".$d14."','".$monthName."','".$year."')";
$run = mysql_query($dbs);






php mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 5 at 13:05









Marc Delisle

7,90231926




7,90231926










asked Dec 28 '18 at 10:55









MichealMicheal

92




92












  • What's your retrieving mechanism? your own PHP script?
    – Marc Delisle
    Dec 29 '18 at 23:22










  • Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
    – Micheal
    Jan 4 at 12:40












  • Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
    – Micheal
    Jan 4 at 12:44










  • I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
    – Micheal
    Jan 4 at 15:34


















  • What's your retrieving mechanism? your own PHP script?
    – Marc Delisle
    Dec 29 '18 at 23:22










  • Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
    – Micheal
    Jan 4 at 12:40












  • Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
    – Micheal
    Jan 4 at 12:44










  • I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
    – Micheal
    Jan 4 at 15:34
















What's your retrieving mechanism? your own PHP script?
– Marc Delisle
Dec 29 '18 at 23:22




What's your retrieving mechanism? your own PHP script?
– Marc Delisle
Dec 29 '18 at 23:22












Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
– Micheal
Jan 4 at 12:40






Hi Marc Delisle, Full file is in the below link: drive.google.com/open?id=1LQzYCPteKANzx2G2rZ4rRtRa8zJCJ0Ft
– Micheal
Jan 4 at 12:40














Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
– Micheal
Jan 4 at 12:44




Also, I am facing another issue, for example if I upload 100 rows of data, sometimes it will upload only 90 and sometimes it will upload 80 rows of data to the database. What might be the reason?
– Micheal
Jan 4 at 12:44












I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
– Micheal
Jan 4 at 15:34




I found answer for the above issue I was facing the reason is if the data consists of words for example AB'C it is not getting uploaded. If the same words are written as ABC it will get upload. That is the reason sometimes 90 rows and sometimes 80 rows was getting uploaded. How to read the word AB'C and upload the same to the database? Thanks in advance
– Micheal
Jan 4 at 15:34












1 Answer
1






active

oldest

votes


















0














I found out answer for my question.



First of all the reason why data was not inserting, my php code was only reading values without special character. So, then I have added the line "mysql_real_escape_string" where ever necessary.



Now data is inserting correctly.



Thanks for the help @Marc Delisle.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53957397%2fdata-is-getting-changed-while-inserting-php%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I found out answer for my question.



    First of all the reason why data was not inserting, my php code was only reading values without special character. So, then I have added the line "mysql_real_escape_string" where ever necessary.



    Now data is inserting correctly.



    Thanks for the help @Marc Delisle.






    share|improve this answer


























      0














      I found out answer for my question.



      First of all the reason why data was not inserting, my php code was only reading values without special character. So, then I have added the line "mysql_real_escape_string" where ever necessary.



      Now data is inserting correctly.



      Thanks for the help @Marc Delisle.






      share|improve this answer
























        0












        0








        0






        I found out answer for my question.



        First of all the reason why data was not inserting, my php code was only reading values without special character. So, then I have added the line "mysql_real_escape_string" where ever necessary.



        Now data is inserting correctly.



        Thanks for the help @Marc Delisle.






        share|improve this answer












        I found out answer for my question.



        First of all the reason why data was not inserting, my php code was only reading values without special character. So, then I have added the line "mysql_real_escape_string" where ever necessary.



        Now data is inserting correctly.



        Thanks for the help @Marc Delisle.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        MichealMicheal

        92




        92






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53957397%2fdata-is-getting-changed-while-inserting-php%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mossoró

            Error while reading .h5 file using the rhdf5 package in R

            Pushsharp Apns notification error: 'InvalidToken'