<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Adam Jimenez Comments</title><link href="http://www.adamjimenez.com/"/><entry><title>Hugo Pickering</title><summary type="html">Hi Adam&#xD;
ever tried ping.fm - you might find it useful</summary><link href="http://www.adamjimenez.com/blog/general/synchronising-facebook-twitter-and-google-buzz#comments"/></entry><entry><title>Adam</title><summary type="html">Thanks Hugo, that's a new one on me. I like the fact that Twitter can receive and push content from youtube, boxee and many others. Whereas from what I can see Ping.fm doesn't have that inbound support and just pushes content to others.</summary><link href="http://www.adamjimenez.com/blog/general/synchronising-facebook-twitter-and-google-buzz#comments"/></entry><entry><title>LnddMiles</title><summary type="html">Great post! I&#x2019;ll subscribe right now wth my feedreader software!&#xD;
</summary><link href="http://www.adamjimenez.com/blog/web-development/knowing-when-to-say-no#comments"/></entry><entry><title>Steve Hollis</title><summary type="html">Short tags are a great way of making PHP mixed with HTML easier to read.&#xD;
&#xD;
Going one step further, a Model View Controller (MVC) system completely separates the design elements (i.e. your HTML with a sprinkling of PHP) from the rest of your application.&#xD;
&#xD;
Designers can then hack away at the HTML without having to get their hands too dirty with the PHP.&#xD;
&#xD;
There are numerous other advantages of using MVC - Zend Framework has this functionality built in, as do a number of other PHP frameworks. </summary><link href="http://www.adamjimenez.com/blog/web-development/separating-php-from-html#comments"/></entry><entry><title>Steve Hollis</title><summary type="html">PDO has the advantage that you can change which database type you use (e.g. MySQL to PostgreSQL or SQLite) just by changing the constructor. In the real world, it's up to you to decide on an individual basis how useful that is - for me, I'm unlikely to use anything other than MySQL.&#xD;
&#xD;
In my view the MySQL(i) extension in PHP is unwieldy and confusing (especially for newbies). I'm using Zend Framework on all my new projects and the ease of use of Zend_Db is incredible. e.g.&#xD;
&#xD;
// inserts a record (automatically escapes etc.) and returns auto_increment ID&#xD;
$data = array( 'name' =&gt; 'Blue Widget', 'size' =&gt; 'Large' );&#xD;
$id = $db-&gt;insert( 'widgets', $data );&#xD;
&#xD;
// returns an array of all widgets&#xD;
$widgets = $db-&gt;fetchAll( "SELECT * FROM widgets" );&#xD;
&#xD;
// returns an assoc. array of id =&gt; name&#xD;
$widgets = $db-&gt;fetchPairs( "SELECT id, name FROM widgets" );&#xD;
&#xD;
Having just converted a legacy project to Zend_Db I've halved the amount of DB related code and increased the security.</summary><link href="http://www.adamjimenez.com/blog/web-development/php-mysql-insert#comments"/></entry><entry><title>Steve Hollis</title><summary type="html">Error in previous code - to get auto_increment ID you need to call $db-&gt;lastInsertId();</summary><link href="http://www.adamjimenez.com/blog/web-development/php-mysql-insert#comments"/></entry><entry><title>Adam Jimenez</title><summary type="html">Thanks for your input Steve.&#xD;
&#xD;
When using zend and inserting can you still use mysql functions like NOW() ?&#xD;
Also when selecting if you have a variable in your select statement, presumably you would need to manually escape it.&#xD;
&#xD;
I watched the introductory screencasts to zend framework. It did strike me as being a bit arduous how you create new pages and having to remember the exact syntax. My homebrew system is much simpler. Altho I'm sure zend is very sophisticated and has some great features.</summary><link href="http://www.adamjimenez.com/blog/web-development/php-mysql-insert#comments"/></entry><entry><title>Steve Hollis</title><summary type="html">To use expressions with Zend_Db you have to use Zend_Db_Expr, e.g. &#xD;
&#xD;
$data = array(&#xD;
    'created' =&gt; new Zend_Db_Expr( 'NOW()' )&#xD;
);&#xD;
&#xD;
If you were writing your own SELECT statements and had a variable, then yes, you'd need to escape them manually. This is where Zend_Db_Select comes into its own - it allows you to construct SQL statements programatically. &#xD;
&#xD;
$select = $db-&gt;select()&#xD;
             -&gt;from( 'widgets' )&#xD;
             -&gt;where( 'colour = ?', $colour );&#xD;
&#xD;
The $colour variable is them automatically inserted where the ? appears.&#xD;
&#xD;
The MVC components of Zend Framework are a steep learning curve - I had two or three bashes at it before I eventually persisted and reaped the rewards. It's also probably overkill for some smaller projects.&#xD;
&#xD;
The main advantage I can see over developing your own system from scratch is the integration with ZF components like Zend_Auth, Zend_Acl, Zend_Form etc. Everything can be extended to meet your needs and I'm finding that projects come together much more quickly when you have these set of reusable components.</summary><link href="http://www.adamjimenez.com/blog/web-development/php-mysql-insert#comments"/></entry><entry><title>Adam Jimenez</title><summary type="html">It's probably getting stuck on one particular site.&#xD;
Try doing a few sites at a time - or checking the migration log.</summary><link href="http://www.adamjimenez.com/blog/general/plesk-migration-hell#comments"/></entry></feed>
