Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

mysql - invalid row index '0'

Hello everyone,

ID
d6ouivfilegovhg7be60
author
demo's avatar

Demo

@demo


View profile
Copy link
  Report member
started
Dec 13, 2019
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
mysql - invalid row index '0'
demo's avatar

Demo

@demo


View profile
Copy link
  Report member
• 6y
Pawn Scripting

mysql - invalid row index '0'

pawn

Hello everyone,



i created a similar mysql login/register system now like this example here:?https://github.com/pBlueG/SA-MP-MySQL/blob/master/example_scripts/login_system-cache.pwn



The only thing i changed is: i dont assign default values after registering server side. I want to get them from db, since i added it there as defaults if a new player registers an account.

How i did this is: if we assume the functions are all the same as the example above, i called?

AssignPlayerData(playerid)

in

public OnPlayerRegister(playerid)

.





Login works fine, but if trying to "AssignPlayerData" after registration i get this error for every data i want to to get.

[plugins/mysql] cache_get_value_name_int: invalid row index '0' (number of rows: '0')





If im thinking right, this is because the entire query to get data is in OnPlayerConnect, and if account does not exists we have no row for that player. So do i need to do the same query again after registering the player and before "AssignPlayerData" ? Is this the right way, or is there a cleaner way?

0 likes0 replies

    Please sign up or log in to reply