mysql命名约定

Liz*_*ard 1 php mysql conventions naming-conventions hungarian-notation

我一般总是Hungarian Notation在我的表中使用某种字段名称,例如

#Table Users
u_id, u_name, u_email etc...

#Posts
p_id, p_u_id, p_title, p_content etc...
Run Code Online (Sandbox Code Playgroud)

但我最近被告知这不是最佳做法.有更标准的方法吗?我真的不喜欢只使用该字段,id因为这需要您选择table.field对于使用连接等时出现在多个表中的字段名称

您对什么是最佳实践的想法将不胜感激.

Ser*_*sov 7

最佳实践对您或您的团队来说是最舒适的.每个程序员都对使用符号有自己的看法.