3 ms·
> Using a dynamic table name is pretty standard practice. The reason for that is to allow a table prefix, allowing multiple of the same app within a single data
by dozzie 10y ago
> Using a dynamic table name is pretty standard practice. The reason for that is to allow a table prefix, allowing multiple of the same app within a single database.
This is precisely how PHP programmers think: that MySQL is somehow the gold
standard in the databases world.
Table prefixes are just the stupid way of emulating database schemas where
it's not supported, which is only MySQL (SQLite doesn't support this either,
but it was never meant for web applications anyway).
- tyingq 10y agoTable prefixes aren't just used in PHP. Ruby/Rails, Grails, etc. And the general idea of dynamic, variable bound table names can be found in almost any language. Schemas are nice, but as you mention, two of the most popularly used databases don't support it. Edit: And, for what it's worth, the affinity for Mysql in PHP code is most likely because both are there, by default, in shared hosting environments. I don't personally know any PHP devs that find Mysql to be a "gold standard". Most popular PHP apps and frameworks support Postrgres as well.
- dozzie 10y ago> Schemas are nice, but as you mention, two of the most popularly used databases don't support it. Yeah, two databases. One that was designed as an embedded storage engine and was never intended for web applications and the other that historically was probably the shittiest one (silently damaging unicode data, silently damaging foreign keys in some circumstances, silently ignoring CHECK constraints, and using non-ACID data store unless asked otherwise, though the last one was fixed just few years back) and should have died long time ago.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- tyingq 10y agoAll true, but I just don't see it supporting your original assertation that PHP devs collectively think a certain way. Support for those two databases, in web applications, is not unique to PHP. I see plenty of golang, node, ruby, python, etc, code that supports them.