WordPress Database Error

I’ve been running into problems ever since I upgraded WordPress to 2.x (not sure if it was 2.0 or 2.1) with new posts. The first time a new post was was loaded into the browser, the server kicked out this error:

PHP Warning: mysql_affected_rows() [<a href='function.mysql-affected-rows'>function.mysql-affected-rows</a>]: A link to the server could not be established in /Users/alex/Dev/SilverSpider/site/wp-includes/wp-db.php on line 183

I searched to find an answer when I first ran into the problem, but never found a solution. Then, while I was working on the Ma.gnolia plugin, it cropped up again, so I began comparing my install to the stock set up and and found that my old wp-config.php contained some lines that are not included in the 2.x wp-config-sample.php:

$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;

As I upgraded from 1.x, and the instructions say not to mess with the config file, I hadn’t looked into it as a possible source of the problem, but by removing this block of code, all appears to be running properly, at least in my local development environment. This post will either reinforce my theory or blow it to bits…

Show time!

It works!

Well, this post worked perfectly and did not generate an error. If you upgraded from 1.x to 2.x and are running into this problem, backup your wp-config.php and then remove that block of code and try it for yourself. Please let me know if that doesn’t work for you. I’ve filed a ticket so this will be resolved all official-like (3992).

Perhaps Not…

Damn it! The error just re-appeared after I edited this post. Grrr.

The New Ma.gnolia WordPress Plugin

Barry Price, the creator of the Ma.gnolia plugin for WordPress has set its development aside and has encouraged me to adopt the project. As I use the plugin heavily on this site, and I enjoy development, I decided to take him up on it.

This plugin makes it easy to output a list of your Ma.gnolia bookmarks anywhere on your site. You can set it to only pull bookmarks with a specific tag, which is great for listing sites related to a specific category or post.

Please download the plugin and provide me your feedback in the comments of this page. I’ll do my damnedest to fix any bugs you report and look forward to expanding it to be even more useful!


I’ve updated the plugin. Please go to the official page for the latest version: Ma.gnolia Plugin.
Magnolia WordPress Plugin

Make sure to join the Plugin group on Ma.gnolia to add your site to the list if you are using this plugin!


  • Drop the entire plugin folder into wp-content/plugins/ – the final paths will be:
    • wp-content/plugins/magnolia/last_rss.php
    • wp-content/plugins/magnolia/magnolia.php
  • Activate the plugin in the admin area of your wordpress install

To Use

This plugin is very basic at the moment, so all it takes once you’ve installed the plugin is a single line of PHP, inserted wherever you want the list of links to appear. You can pass the following variables to the plugin:

  • $username is the Ma.gnolia account to use, this is typically your account.
  • $numLinks sets the amount of links you want the tag to output, this defaults to 10.
  • $showDescriptions tells the tag whether or not it should include descriptions in the output. This defaults to “Do Not Show”.
  • $showPubDates tells the tag whether or not it should output the date the URL was bookmarked in Ma.gnolia. This defaults to “Do Not Show”.
  • $useMagnoliaLinks determines whether the links should point directly to the bookmarked URL, or the bookmark’s page on Ma.gnolia. This defaults to the Bookmark’s actual URL.
  • $tag allows you to pass in a tag to narrow down the list of results. Only bookmarks matching that tag will be output. This is empty by default, so it pulls all bookmarks regardless of their tags. Use a plus sign (+) to separate multi-word tags. For example “web+design”.

The output consists of an unordered list, each link contained in a separate list item tag.

Example of Usage

Here’s a snippet to output three bookmarks, with their associated descriptions from my bookmark list, regardless of the tag.

<?php magnolia('BaldTechnologist',3,1,0); ?>

Example Output

<li><a href="http://www.flickr.com/photos/17328648@N00/sets/1737284/" title="Cool &amp; Wacky Records - a photoset on Flickr:: No Description" class="ToolTip">Cool &amp; Wacky Records - a photoset on Flickr</a></li>
<li><a href="http://www.fortymedia.com/blog/post/59" title="Attention Mapping: The 10-Point Exercise:: Attention is the most fundamental unit of design. Once you get past the color schemes, typography, layouts, graphical treatments, etc., it all comes down to guiding and shaping the viewer’s attention." class="ToolTip">Attention Mapping: The 10-Point Exercise</a></li>
<li><a href="http://haha.nu/misc/html-tags-illustrated/" title="HTML Tags illustrated:: A collection of photos that demonstrate HTML tags." class="ToolTip">HTML Tags illustrated</a></li>
<li class="MagnoliaLink"><a href="http://ma.gnolia.com/people/BaldTechnologist/bookmarks" title="Alex Jones on Ma.gnolia::Browse through the sites and pages that I have added to my bookmark list on Ma.gnolia. If you're a member, add me as a contact!" class="ToolTip">View my bookmarks on Ma.gnolia</a></li>

Other Examples

Five Bookmarks Tagged with “Design”, No Descriptions, Pointing to the Original URL

<?php magnolia('BaldTechnologist',5,0,0,0,'design'); ?>

Ten Most Recent Bookmarks with their Descriptions and the Time they Were Saved to Ma.gnolia, Pointing to the Link’s Ma.gnolia URL

<?php magnolia('BaldTechnologist',10,1,0,0,'History'); ?>

Behind the Scenes

Barry Price built the first version of this plugin, and what you see here is a a modified version of his work the Last RSS Parser, which does much of the heavy lifting. At this point, Alex (BaldTechnologist on Ma.gnolia) has picked up the project and will be adding features as suggestions come in and time allows. If you have an idea, please contact me and I’ll see what I can do!

Contribute, for Free!

It’s easy to support this free plugin, and it won’t cost you a thing! Here are a few simple ways:

  • When you plan to buy something from Amazon, follow this link (Amazon.com). It won’t cost you anything, but it will add a small amount of your purchase to my account.
  • Write about the Ma.gnolia for WordPress plugin on your site
  • Add a link back to my site (www.silverspider.com) from yours
  • Drop me a line to say hi and let me know where you are running the plugin.

Changes Made

I’ve made some changes, both major and minor to the plugin, including:

  • Changed quote usage from single quotes to double quotes to improve parsing efficiency.
  • Improved comments within the script
  • Moved the feed parser class (Last RSS) to a separate file for ease of maintenance.
  • Various code, formatting and commenting changes

Upcoming Changes

These are not currently prioritized, but I want to add these features/implement these revisions:

  • Add CRON abilities to pre-cache feeds instead of waiting for a request
  • Add ability to search multiple tags (AND & OR)
  • Add the ability to pull from groups in addition to by tags
  • Documentation with some examples
  • Improve configuration options
  • …(this is where your suggestions come in)

Ma.gnolia & Me

Rick, a great Web Developer with whom I’ve worked in the past, and now count as a friend was kind enough to write about me being a featured linker on Ma.gnolia on his blog, Walking Around. In addittion to the pleasant surprise of seeing my name show up in the feed for his site, it was great to see that Rick has rediscovered Ma.gnolia, as I think it is a rockin’ tool that I hope lives up to his needs.

Speaking of tools, Barry Price, the creator of the Ma.gnolia plugin for WordPress has set its development aside and has encouraged me to adopt the project. As I use the plugin heavily on this site, and I enjoy development, I decided to take him up on the offer and have begun tweaking the plugin, with a goal of releasing a new version (likely 1.3) in the next week. The changes will be minor, but there are some features that I look forward to including in the near future. If you have any requests, please drop me a line!


I’ve posted version 1.3 of the Ma.gnolia plugin.

The Rebirth of the End of the World

The time has come for Apocalyptic Dreaming to rise from the pitiful state that it has devolved into. Running for years with an old design atop an outdated content management system, the site had become a burden to me, its creator. So, I present a revitalized site, ready to display its much improved strength, reliability and extra floppy appendages.

Dear Lord…What have I done?!

Many many many changes have been implemented and much toil was experienced in order to bring forth a stronger site. These changes include:

  • Porting the site from MovableType 2.6 to WordPress 2
  • Designing a new standards-compliant (XHTML + CSS) site from the ground up, with a focus on readability, usability and future expansion.
  • Implementing a user registration system (through WordPress) which will speed up postings of new entries while easing my workload.
  • Discrete implementation of Ad Sense to cover a little bit of the cost incurred for running the site