DbQuery issue

Game development with Board Game Arena Studio
Post Reply
User avatar
cora89
Posts: 29
Joined: 14 June 2012, 20:29

DbQuery issue

Post by cora89 »

Hello,

i have written this and it doesn't work...

$sql = "UPDATE board SET board_color='$playerTokenColor' WHERE board_x ='$token_place' ";
echo $sql;
self::DbQuery( $sql );
die('OK');

it echoes
UPDATE board SET board_color='ff0519' WHERE board_x ='69' 'OK'

but my board database in 69, color is still set at NULL ! (event when i'm not doing any echo stuff).

in a former function i used it with the player database and it worked well. Is that due to the structure of board database ? my primary key is board_x.
What did i miss ???
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Re: DbQuery issue

Post by sourisdudesert »

Hello,

Be careful, transactions are used in BGA. If your request does not end, changes in your DB will not be shown in PhpMyAdmin.

If you do a select immediately after your update and display the result, you will see that the database has been updated.

More information here:
http://en.doc.boardgamearena.com/Main_g ... g_database

Cheers,
User avatar
cora89
Posts: 29
Joined: 14 June 2012, 20:29

Re: DbQuery issue

Post by cora89 »

thanks.

in fact, i had an infinite loop in my game.php, so the query worked but after that there where a time error...
Now it's ok :D
Post Reply

Return to “Developers”