Tuesday, April 21, 2009

PHP and MySQL (part 1)

I have PHP and MySQL talking. It took a bit more than I expected; most of the work was in the installation and set-up of files for PHP. I had to install the DB and PEAR packages and then modify the PHP.ini file to specify an include path. I also modified some web pages to use PHP commands to access a database and created a MySQL database with some tables and some test data. Not quite as easy as MS-Access, but not too hard either.

I was assisted by the detailed error messages from PHP. (And also from MySQL, for earlier configuration problems.) The designers of both packages followed the rule "complain early and noisily", and it helped me solve the problems.

Most Windows programs, in my experience, do not follow this rule. They write errors to logs in obscure places and the messages are detailed but not useful. A typical log entry might be "call to SqlProcessor(...) returned code 0x800503ad" or some such jargon. I'm guessing that the message is useful to a Microsoft developer, one who is familiar with the internals of the components, but it is quite opaque to me. I have no idea what 0x800503ad means, and Google searches usually reveal a multitude of causes.

My experiments with PHP and MySQL are not completely successful. The example I used from the book Programming PHP fails with the message "undefined fonction 'fetchinto' ". I'm not sure if this is a PHP version problem (I'm using version 4, the older version) or something else. But all is not lost, as I can look inside the DB.php module and see the code. That's a task for tomorrow.

In other work today, I turned on my resume on monster.com. I have been somewhat reluctant to do this; the last time I made a resume public I was flooded with lots of requests that were only remotely connected to my objective. Most recruiters saw "C++" on my resume and immediately offered a position with C++. They made the assumption that since I had C++ experience I desired another position with C++. This is not the case, as I want to move to web technologies (PHP, JSP, and possibly ASP.NET) and other new technologies (Ruby, Ruby on Rails). Well, my resume is public. Let's see what happens.

I also spent some time out in the sun, reading in the local park. The reading was all non-PHP and non-MySQL. I read some chapters in Language by Bloomfield, Sagan's The Dragons of Eden, and a short story by Lester del Rey. I think the sun and the reading were both theraputic.

No comments:

Post a Comment