SA-MP Forums Archive
MySQL, Undefined symbol, and more errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL, Undefined symbol, and more errors (/showthread.php?tid=616293)



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.

pawn Код:
new a;
new b[32];
You can create two variables without having to repeat "new" keyword, using a comma

pawn Код:
new a, b[32];
But you have a typo, and did

pawn Код:
new a; b[32];
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(querysizeof(query), "Select from accounts where name = '%s'"pName); 



Re: MySQL, Undefined symbol, and more errors - Sanady - 03.09.2016

PHP код:
format(querysizeof(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!