Skip to main content

Debugging Success

I used PDT, a PHP version of eclipse, to debug my issues. I had to add the Wordpress files to the PHP include of my project, then I could run my script in debug mode.

My issues were multiple. The syntax error was an extra closing parenthesis (doh!).

More importantly, $wpdb->query did not work as I expected. If the query fails, it returns false. If the query succeeds, it returns the number of rows acted on (rows selected, or inserted, or deleted, etc...). Was more confusing to me, but makes sense I guess, is that $wpdb->print_error() will still return a valid String on success, complete with an error message (but no error). So my insert was succeeding, but I thought I had an error, causing my error logic to execute.

All better now. I now have my first working plugin!

Comments

Popular posts from this blog

rootsPersona

Want to manage a Family Tree online? Create a map of your ancestors using WordPress? Announcing a new plugin, rootsPersona . rootsPersona is plugin I wrote to manage and present Genealogy data for a family website run on WordPress. I looked at several options already out there, within WordPress and without, and found nothing to my liking, so I developed this plugin, and found myself very happy with the results. I hope you do too. rootsPersona creates one or more pages of family history using data imported from a GEDCOM file (version 5.5). Check it out at http://wordpress.org/extend/plugins/rootspersona/

Hard SciFi Revisited

DePauw University has some excellent articles archived on the Hard Science Fiction genre. I found it interesting that books dealing with social or religious issues are more marketable than those dealing with harder topics. But no, I guess it makes sense.

What is a Space Opera?

I ask because I am reading Alastair Reynolds' 2000 novel Revelation Space , and that is how it is being touted. Apparently that label was not originally a positive one. Wikipedia states that it was originally applied to "the hacky, grinding, stinking, outworn space-ship yarn, or world-saving [story]". It is more generally applied to stories where "settings, characters, battles, powers, and themes tend to be very large-scale". OK, I assume the second is the reason it is applied to Revelation Space . It's taking me some time to read it, and it was a little slow to get into, but now that I am, I want to see what happens. I will be reviewing it at jupiterthree.com when I finish it.