所以我可以删除一行:
$this->db->delete($tableName,array("id"=>4));
Run Code Online (Sandbox Code Playgroud)
...但我无法弄清楚如何删除多行.我试过了:
$this->db->delete($tableName,array("id"=>4,"id"=5));
Run Code Online (Sandbox Code Playgroud)
以及:
$this->db->delete($tableName,array(array("id"=>4),array("id"=5)));
Run Code Online (Sandbox Code Playgroud)
......但它们都不起作用.我觉得这应该很容易.任何答案?
在命令行中,这将成功更新table1:
pt-table-sync --execute h=host1,D=db1,t=table1 h=host2,D=db2
Run Code Online (Sandbox Code Playgroud)
但是,如果我想更新多个表,我不知道如何编写它.这只会更新table1并忽略其他表:
pt-table-sync --execute h=host1,D=db1,t=table1,table2,table3 h=host2,D=db2
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误:
pt-table-sync --execute h=host1,D=db1 --tables table1,table2,table3 h=host2,D=db2
Run Code Online (Sandbox Code Playgroud)
任何人都有一个如何列出'-tables'的示例...以便它成功更新列表中的所有表?