Data is getting changed while inserting php
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
add a comment |
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
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
add a comment |
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
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
php mysql
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered yesterday
MichealMicheal
92
92
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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