Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我尝试执行由于键约束错误而失败的插入,有没有一种方法可以在不对错误文本进行字符串解析的情况下获取键的名称?
我已经知道错误代码是 1062;我想找出哪个键约束失败:)
“不做错误文本的字符串解析?” - 不,据我所知,做类似的事情
preg_match("/for key '(.+)'$", $msg, $matches)
是你最好的机会。