So, yesterday I talked about SimpleXML and the basic way to access the XML data. Today I’ll be covering simple XPath queries and modification.
I’m not sure I totally understand the real purpose of these, but Iterator interfaces are used for performing actions on certain actions/events while iterating the data. From what I understand, implementing RecursiveIteratorIterator will perform actions when entering or exiting a new level of nodes (beginChildren() and endChildren()) when iterating (foreach() / next()) through a recursive object.
Then the FilterInterator interface determines what items should be displayed while iterating. By implementing the accept() method, you can return true to display or false to skip.
I can’t spend a lot of time on this tonight. Been very busy. Have like 15 people over at my house. So I’ll try to be quick.
Anyway, this chapter is all about design patterns in Object-Oriented Programming:
Now, yesterday I talked about the basic PDO implementation of MySQL. Today I’m going to cover PHP’s new MySQL Improved Extension (MySQLi). It actually has two methods of approach: the Object-Oriented way and the Procedural way (why?). Here is a basic open and close connection:
Well, I’ve finished half the chapters. But those were the easy ones! Today’s chapter is Database Programming. Sadly most of the chapter is about SQL itself: data types, how to create tables, creating relationships/indexes, inserting/updating, transactions, etc. Fourteen pages later and we get to the actual PHP code.