一个关于MYSQL事务处理的选择题,顺便散分。
关于下边的三道选择题,那几个是正确的?当然前提是你是用了InnoDB、BDB等等事务安全表。
① mysql_query("BEGIN");
mysql_query("select * from web_info for update");
if (!mysql_query("update web_info set info_title =dalslsls")) {
mysql_query('ROLLBACK');
} else {
mysql_query('COMMIT');
}
② mysql_query("LOCK TABLES web_info WRITE");
mysql_query("select * from web_info");
if (!mysql_query("update web_info set info_title =dalslsls")) {
mysql_query('ROLLBACK');
} else {
mysql_query('COMMIT');
}
mysql_query('UNLOCK TABLES');
③ mysql_query("LOCK TABLES web_info WRITE");
mysql_query("BEGIN");
mysql_query("select * from web_info");
if (!mysql_query("update web_info set info_title =dalslsls")) {
mysql_query('ROLLBACK');
} else {
mysql_query('COMMIT');
}
mysql_query('UNLOCK TABLES');
另外,这几天解决了的一个空白窗体不是全屏情况处理的javascript函数,送给大家(可能有很多人都已经知道了)。
function openDualWeb() {
url = "http://localhost/index1.html";
try {
anInternetExplorer = new ActiveXObject("InternetExplorer.Application");
anInternetExplorer.fullscreen = true;
anInternetExplorer.top = 100;
anInternetExplorer.left = 100;
anInternetExplorer.width = 100;
anInternetExplorer.height = 100;
anInternetExplorer.navigate(url);
anInternetExplorer.visible = true;
} catch(e) {
alert(e);
}
}