Most of my experience is on the MSFT stack, but I am now working on a side project, helping someone with a personal site with cheap hosting that is built on the LAMP stack. My options for installing extras are limited, so I'm wondering about how to write my data access code without embedding raw queries in the .php files.
I like to keep things simple, even with .NET. I generally write stored procedures for everything, and I have a helper class that wraps all calls to execute procedures and return data sets. I'm not looking for a full-blown ORM, but it might be the way to go and others who view this question might be looking for that.
Remember that I'm on a $7/month GoDaddy account, so I'm limited to what's already installed in their basic package.
Edit: Thanks rix0rr, Alan, Anders, dragon, I will check all of those out. I edited the question to be more open to ORM solutions, since they are so popular.
You can use the php function mail($to, $subject, $body) to send the email address to your personal email. The data will not be readable from your script, but for your use case this might be ok.
PHPMyAdmin is able to handle unlimited amount of data when it comes to exporting a table to sql, csv or spreadsheets.
Go to localhost/phpmyadmin, find the database, and then click on the SQL tab. Find the database before following this step. Now, paste the output in the text area and then click on the 'Go' button. STEP 4: Error, the query is debugged, Check the 'MySQL said' part to know the error with the query.
ActiveRecord seems to be the state of the art at the moment. I can't recommend any good PHP frameworks for that though. I tried Propel which, while nice, is not easy to set up (especially on a host that you can't install anything on).
Ultimately, I rolled my own ORM/ActiveRecord framework, which is not too much work and very instructive. I'm sure other people can recommend good PHP frameworks.
Take a look at the Zend Framework, specifically Zend_Db. It has a Database Abstraction layer that doesn't require anything other than the MySQLi extension to be installed and isn't a full-blown ORM model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With