MySQL Issue?
#1

Alright, I am finally attempting to take on the knowledge of MySQL and to begin script with it fluently, but for some reason I am getting this bug when trying to read the player's name from the database:

pawn Код:
format(Query, sizeof(Query), "SELECT `nick` FROM `playerdata` WHERE `nick` = %s", Player[playerid][Nick]);
I am getting this error:

pawn Код:
C:\Users\namder\Desktop\Lost Life Roleplay\gamemodes\CoVRP.pwn(89) : error 001: expected token: ";", but found "-identifier-"
I am truly confused; however any help and explanation would be greatly appreciated!
Reply
#2

Look to the line above it, is there a ";" at the end of the line above this line?
Reply
#3

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
Look to the line above it, is there a ";" at the end of the line above this line?
Lol, why did I not think of that? My ignorance lead to the issue you just helped my solve, thanks! You have been given your first reputation point, thanks again!
Reply
#4

Haha, thanks :P
Reply
#5

That query is going to (or should) return an error, by the way. You have to put apostrophe's around string place-holders (at least that's what I call the %s's in a string).

So, where you have:

pawn Код:
`nick` = %s
... it should be:

pawn Код:
`nick` = '%s'
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)