Page 1 of 1

DbQuery issue

Posted: 22 February 2013, 22:11
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 ???

Re: DbQuery issue

Posted: 22 February 2013, 22:17
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,

Re: DbQuery issue

Posted: 08 March 2013, 17:58
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