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

Bug: Strings consisting of digits only and starting with 0 are saved without leading zeros #22

Closed
technicalguru opened this issue Jul 21, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@technicalguru
Copy link
Owner

Symptom: a value like '036876' that shall be saved as string in database is saved as '36876' (leading zero stripped off).

Reason: TgDatabase\Database class method prepareValue() decides on is_numeric() only whether the value needs quoting or not. Leading zeros are stripped of then when saving to database because the quotes are missing.

@technicalguru technicalguru added the bug Something isn't working label Jul 21, 2021
@technicalguru technicalguru self-assigned this Jul 21, 2021
@technicalguru
Copy link
Owner Author

Solution: use combination of is_numeric() and is_string() to decide on quoting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant