Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when use DB MS SQL #1896

Open
herdianabdillah opened this issue Feb 17, 2021 · 9 comments
Open

Issue when use DB MS SQL #1896

herdianabdillah opened this issue Feb 17, 2021 · 9 comments

Comments

@herdianabdillah
Copy link

Describe the bug
cant insert chinese, japan, thai character in MSSQL, because data type is "varchar"

To Reproduce
Steps to reproduce the behavior:

  1. Go to add new FAQ
  2. Create a FAQ with chinese, japan or thai character and then save
  3. it will become question mark

Expected behavior
able to input that character

phpMyFAQ (please complete the following information):

  • phpMyFAQ version 3.0.7
  • PHP version 7
  • Database : MS SQL
  • Elasticsearch no

Additional context
i already fix the issue manually with change data type into "nvarchar" also in the query add N before string

@herdianabdillah herdianabdillah changed the title Issue When use DB MS SQL Issue when use DB MS SQL Feb 17, 2021
@thorsten thorsten self-assigned this Feb 17, 2021
@thorsten thorsten added the Bug label Feb 17, 2021
@thorsten
Copy link
Owner

@herdianabdillah The fix is varchar -> nvarchar?

@herdianabdillah
Copy link
Author

@thorsten not only that. in the query also need to add N before the string. in the code should be like this N'%s'

@thorsten
Copy link
Owner

e.g. INSERT INTO faqdata (col_with_nvarchar) VALUES (N'phpMyFAQ') ?

@thorsten
Copy link
Owner

Okay, I found some examples on StackOverflow. This is a big change.

@thorsten thorsten added this to the 3.1 milestone Feb 17, 2021
@thorsten
Copy link
Owner

@herdianabdillah What do you think, should I change all VARCHAR() columns to NVARCHAR() or just the ones with user generated content?

@herdianabdillah
Copy link
Author

e.g. INSERT INTO faqdata (col_with_nvarchar) VALUES (N'phpMyFAQ') ?

yes, like that

@herdianabdillah
Copy link
Author

herdianabdillah commented Feb 17, 2021

@herdianabdillah What do you think, should I change all VARCHAR() columns to NVARCHAR() or just the ones with user generated content?

from my case, just the ones with user generated content. like category, faq title, body, keyword, etc. and some case in the user field too for full name so i also change that

@thorsten thorsten modified the milestones: 3.1, 3.2 Feb 27, 2021
@thorsten
Copy link
Owner

Moving this to the 3.2 milestone as it has a huge impact.

@stale
Copy link

stale bot commented Dec 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 31, 2022
@thorsten thorsten removed the wontfix label Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants