project-error / npwd

NPWD is a FiveM phone resource written entirely in TypeScript and React.
https://projecterror.dev
Other
351 stars 277 forks source link

I keep getting an error saying "Failed to store phone number in database" #881

Closed IndigoBerry closed 1 year ago

IndigoBerry commented 2 years ago

Development Issue

Unsure

Phone Version

1.6.1

Issue Description

I dont know what i did wrong but when somebody joins my server it says this in the console: [ script:npwd] [NPWD] [player] [error]: Failed to store phone number in database [ script:npwd] [NPWD] [player] [error]: UPDATE users SET phone_number = 675-743-9363 WHERE identifier = eef92ab7dcef11325680163d0653768e80a43f14

i also get in oxymysql this: [ script:oxmysql] SCRIPT ERROR in promise (unhandled): Error: pe-core was unable to execute a query! [ script:oxmysql] Data too long for column 'identifier' at row 1 [ script:oxmysql] INSERT INTO ?? (??,??) VALUES (?,?) ["users","identifier","phone_number","license:372611967ce989ed30f3d3ffc6a921641a3f4848","200-983-3386"] [ script:oxmysql] > (@oxmysql/dist/build.js:21786) [ script:oxmysql] > processTicksAndRejections (node:internal/process/task_queues:96) [ script:oxmysql] > async rawQuery (@oxmysql/dist/build.js:21755) [ script:oxmysql]

Issue Reproduction

  1. Start Server
  2. Join server
  3. look at console
  4. see error

Evidence

Screenshot_2

Visloczki commented 2 years ago

Hi!

Use database prefix. Example :

"database": { "useIdentifierPrefix": true, "playerTable": "users", "identifierColumn": "identifier", "identifierType": "char1", --- this line "profileQueries": true, "phoneNumberColumn": "phone_number" },

and dont forget alter your users phone_number field to varchar(20)

Regards. Adam

Itzyaboizordan2 commented 2 years ago

im also getting a error for this but i did what u said and nothing still gives a error or phone doesnt work at all

Visloczki commented 2 years ago

im also getting a error for this but i did what u said and nothing still gives a error or phone doesnt work at all

You updated phone_number field type to varchar20 ?

Blacky5613 commented 2 years ago

I have the exact same mistake and did it almost exactly as they wrote it down.

Screenshot_2

Screenshot_1 Screenshot_3

Br4inFish commented 2 years ago

im also getting a error for this but i did what u said and nothing still gives a error or phone doesnt work at all

You updated phone_number field type to varchar20 ?

Hey mate, I've followed your guide, I can't get this to work, Still get this error after the fix you provided. Do you mind sharing some more help for this ?

stale[bot] commented 1 year ago

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.

TheOnly3aq commented 1 year ago

I know I'm a bit late to this, but you need to install https://github.com/project-error/pe-core, this will put an identifier in your users table so that npwd can use that to link a phone number to a user.

See: https://projecterror.dev/docs/npwd/start/installation#basic-configuration

It says it in the caution area.