Thursday, November 13, 2008

MySQL Reading : Notes

I just completed the MySQL Tutorial and these are some notes related to the reading.

For the first half of the tutorial I followed along by creating a database and different tables on my own server. We did most of this in class but it was helpful to do it again and sometimes with a different method... like creating a table from using PHP and the "CREATE TABLE" MySQL query function.

The tutorial doesn't mention anything about Foreign Keys or even Primary Keys for that matter. The only mention of two table relating to each other was through Join or Left Join. The tutorial admitted you probably wouldn't understand join from the super simple example. In some other reading I'm realizing Foreign Keys for MySQL have to be assigned by command line as there is no graphic interface for this. I've only worked on this weeks homework assignment for a few hours and I'm having a big issue with table relation.

In practice I brushed up on my formatting of the result and syntax of PHP but I still get a lot of totally blank pages with no errors. Very frustrating. I'm guessing that is due to poor syntax. Debugging methods aren't helping either. Lot to learn still.

I found SQL Injection mysql_real_escape_string() interesting in part because this process of protection is used when running a query for results. In short used when getting data and it kept bugging me that this isn't used when inserting data to the table. Actually I think I'm mixing up the PHP process for sanitizing the user input and the SQL process for making sure nothing malicious is run on the database. Does SQL even have protection on INSERT?

Well, on to defining my final project and getting that blog to work correctly.

No comments: