MySQL[]
#4

Quote:
Originally Posted by Eyce
Посмотреть сообщение
This line:
pawn Код:
format(Query,sizeof(Query),"INSERT INTO `users` (pName,pPass,pAdmin,pCash) VALUES ('%s','%s,'%i','%i')",pName,EscapedText,PInfo[playerid][pAdmin],PInfo[playerid][pMoney]);
You just missed an apostrophe on the second placeholder. Use this:
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `users` (`pName`, `pPass`, `pAdmin`, `pCash`) VALUES ('%s', '%s', '%i', '%i')", pName, EscapedText, PInfo[playerid][pAdmin], PInfo[playerid][pMoney]);
Like you said but got this

Код:
[16:11:36] ---------------------------

[16:11:36] MySQL Debugging activated (09/08/13)

[16:11:36] ---------------------------

[16:11:36]  

[16:11:36] >> mysql_connect( )

[16:11:36] CMySQLHandler::CMySQLHandler() - constructor called.

[16:11:36] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "database" | Username: "root" ...

[16:11:36] CMySQLHandler::Connect() - Connection was successful.

[16:11:36] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

[16:14:00] >> mysql_query( Connection handle: 1 )

[16:14:00] CMySQLHandler::Query(SELECT `pName` = 'Wazz' FROM `users`) - Successfully executed.

[16:14:00] >> mysql_store_result( Connection handle: 1 )

[16:14:00] CMySQLHandler::StoreResult() - Result was stored.

[16:14:00] >> mysql_num_rows( Connection handle: 1 )

[16:14:00] CMySQLHandler::NumRows() - Returned 0 row(s)

[16:14:00] >> mysql_free_result( Connection handle: 1 )

[16:14:00] CMySQLHandler::FreeResult() - Result was successfully free'd.

[16:14:06] >> mysql_real_escape_string( Connection handle: 1 )

[16:14:06] CMySQLHandler::EscapeString(testpass); - Escaped 8 characters to testpass.

[16:14:06] >> mysql_query( Connection handle: 1 )

[16:14:06] CMySQLHandler::Query(INSERT INTO `users` (`pName`,`pPass`,`pAdmin`,`pCash`) VALUES ('Wazz','testpass) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''testpass' at line 1)
Quote:
Originally Posted by Misiur
Посмотреть сообщение
Just a heads up, you've got a little overflow going in there - change query size from 80 to something bigger.
Please give me a code i don't understand what are you talking about...
Reply


Messages In This Thread
MySQL[] - by xganyx - 08.09.2013, 04:53
Re: MySQL[] - by Eyce - 08.09.2013, 05:00
Re: MySQL[] - by Misiur - 08.09.2013, 08:59
Re: MySQL[] - by xganyx - 08.09.2013, 09:13
Re: MySQL[] - by Dragonsaurus - 08.09.2013, 09:15
Re: MySQL[] - by playbox12 - 08.09.2013, 09:28
Re: MySQL[] - by Konstantinos - 08.09.2013, 09:46
Re: MySQL[] - by xganyx - 08.09.2013, 09:49
Re: MySQL[] - by Dragonsaurus - 08.09.2013, 09:54
Re: MySQL[] - by Misiur - 08.09.2013, 10:10

Forum Jump:


Users browsing this thread: 1 Guest(s)