How can I manage to lock or unlock access db query table. e.g. I have a game which displays few questions and then answers which are taken fromt the access db records. What I want is during the game play, it should remain lock till it is accesed, so that player can't know what is inside db.

Use MS Access to put a password on it. Then you will have to change your program to use that password when opening the database.

mysql_query("LOCK TABLES mytest WRITE;");

for ($i = 1; $i < 100000; ++$i) {
    mysql_query("INSERT INTO mytest (Value, Value2, Value3) VALUES ($i, $i, $i);");
}

mysql_query("UNLOCK TABLES;");



                       OR



mysql_query("LOCK TABLES mytest READ;");

for ($i = 1; $i < 100000; ++$i) {
    mysql_query("INSERT INTO mytest (Value, Value2, Value3) VALUES ($i, $i, $i);");
}

mysql_query("UNLOCK TABLES;");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.