For about 6 monthes I’ve been developping my website on a local WAMP server, and now that I’m trying to make it run on infinityfree, I getting on a roll of “access violation” errors when running some sql queries.
I have found that stored procedures are not allowed on free-hosting.
I didn’t find anything about creating temporary tables, but since views aren’t allowed either, and I’m getting an access violation anyway, I assume it’s a no-go. (Though I couldn’t find whether views are a free-hosting restriction.)
These are things I guess I’ll have to work around; but before I keep shooting myself in the foot any more, did I miss a list, somewhere, that would tell me everything else I am not allowed to do on these databases ?
MySQL has a HUGE number of features. Some of these are not available on purpose, some of these are not available because of platform limitations and some of these are not available as a consequence of either of the above. I’m not sure if it would be possible to create an exhaustive list of everything that is not allowed or supported.
The temporary table restriction is a known limitation:
I suppose a good place to start would be the supported MySQL privileges list:
Of the privileges listed here, only the ALTER, CREATE, DELETE, DROP, INDEX, INSERT, SELECT, UPDATE and LOCK TABLES privileges are granted.
The point is that you can use MySQL as a quite dumb data store. Loading application/business logic into MySQL in any way is not possible.
If you want to change how data from the database is represented, do it in PHP. If you want to load intermediary data in memory for processing, do it in PHP. If you need some data change to affect other data as well, do it in PHP.
If you are looking for any particular features, I can look into whether it’s possible or not.
Thanks, though I wouldn’t say I was using these for application logic. The stored procedure where a way to enforce constraints on some columns through triggers. The temporary table was just an attempt at optimizing the query.
I could argue that constraints themselves are a kind of business logic. For example, “every order should be owned by a customer” is a sensible part of business logic for an online store. It would also be conceivable that the order could be created by a guest as well, which is a business decision.
These constraints could also be enforced through PHP, although it might be a more cumbersome to do so (depending on the structure of your application).
But on free hosting, foreign keys, stored procedures and triggers are all disabled. So I’m sorry to say you can’t enforce any constraints in that way.
The kind of constraint I was thinking about are more in the line of “emails should contain one arobase” or “slugs should not contain any slash”, which I find closer to the way date are formatted as ‘YYYY-MM-DD’.
Wait, foreign keys are disabled too? I didn’t receive any kind of error when setting up relations between my tables. In the end no relation was made, but the query still says it has run succesfully.