MySQL, Undefined symbol, and more errors -
XHunterZ - 03.09.2016
Hello, i'm learning scripting by watching XSLADEHDX, here's the line and the errors i get on this line
Line:
Код:
new query[126]; pName[MAX_PLAYER_NAME];
Errors:
Код:
:\Users\Divya\Desktop\samp\pawno\CNR.pwn(61) : error 017: undefined symbol "pName"
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(61) : warning 215: expression has no effect
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(61) : error 001: expected token: ";", but found "]"
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(61) : error 029: invalid expression, assumed zero
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(61) : fatal error 107: too many error messages on one line
Re: MySQL, Undefined symbol, and more errors -
Misiur - 03.09.2016
";" is a way of saying to compiler that we reached end of statement.
You can create two variables without having to repeat "new" keyword, using a comma
But you have a typo, and did
Change it to comma and you're good to go.
Re: MySQL, Undefined symbol, and more errors -
XHunterZ - 03.09.2016
Oh, i did that to check if doing so fixes the error, but it didnt.. removed it but it still didnt work.
Re: MySQL, Undefined symbol, and more errors -
XHunterZ - 03.09.2016
Ok, fixed that, but now it shows error on line 63rd, line is
Код:
format(query, sizeof(query), "Select from accounts where name = '%s', pName);
Errors:
Код:
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(63) : error 037: invalid string (possibly non-terminated string)
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(63) : error 017: undefined symbol "Select"
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(63) : error 017: undefined symbol "from"
C:\Users\Divyam\Desktop\samp\pawno\CNR.pwn(63) : fatal error 107: too many error messages on one line
Re: MySQL, Undefined symbol, and more errors -
Shinja - 03.09.2016
Missing a "
PHP код:
format(query, sizeof(query), "Select from accounts where name = '%s'", pName);
Re: MySQL, Undefined symbol, and more errors -
Sanady - 03.09.2016
PHP код:
format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `name` = '%s'", pName);
If you are asking why, becouse in your first query, you are selecting nothing from accounts where name is Sanady for example, so it doesn`t make sanse, in my version. You are selecting everything from accounts where name is Sanady.
Re: MySQL, Undefined symbol, and more errors -
XHunterZ - 03.09.2016
THANKS!