Tag: mysql

wpdb insert returning false

Problem When running wpdb->insert the result returns false.  All the values seem to check out to be fine.   Solution The problem might be due to this bug in WordPress.  Basically one of your fields is too long and WordPress

Tagged with: ,

Where is wp_capabilities?

Problem After creating a user with a certain role I need to do a custom sql query where it only selected users of a specific role.  This failed to find anything: select u.ID, u.display_name, u.user_login from $wpdb->users as u inner

Tagged with: , ,

Speed up WP_Query

In WordPress, when a query does not need paging and you only want a limited amount of results, like the last 5 posts, set the ‘no_found_rows’ parameter to true.  This prevents WordPress from doing additional work in counting the total matched rows,

Tagged with: , ,

Migrating Multisite to Single Site

I needed to migrate a site on a multisite installation to a single installation.  This article did the trick for the most part.   http://beacon.wharton.upenn.edu/404/2011/02/the-return-from-multisite/

Tagged with: ,

WordPress “The plugin generated xxxx characters of unexpected output during activation”

Problem I was developing a plugin for wordpress and receive a messsage: The plugin generated 496 characters of unexpected output during activation Solution I placed the following code at the end of my plugin file, update_option(‘plugin_error’,  ob_get_contents()); then looked in

Tagged with: , , ,

MAMP – MySQL can’t connect after OS X Crash

Problem I had my macbook open, it went to sleep and I couldn’t wake it up.  After holding down the powerbutton for over 10 seconds, it turned on.  Everything was fine until I tried to open the MAMP home page.

Tagged with: , , ,

WordPress Deactive Plugin

Problem I had a wordpress site where the public side was fine, but the admin side was throwing a Internal Server Error 500 intermittently.   I couldn’t figure out what was wrong since I had done no changes, and my host

Tagged with: , ,

mysqldump – Using password: NO error

Problem I need to back up a mysql database on a shared hosting server.  I am using the cron job to run a bash file which runs a mysqlcommand.  The problem is that I can’t get MySQL to recognize the

Tagged with:

LemonStand eCommerce Notes

Lemonstand is an eCommerce solution that lets you try before you buy.  It is very simple to use and virtually no learning curve to develop for.  It uses PHP and mySQL.  Check it out for yourself here. Below are just

Tagged with: , ,

MySQL Auto Backup

The following commands should be run daily.  This will give you a backup for 1 full month.  After 1 month the backups will overwrite the oldest files.  The %d is the day of the month. GoDaddy: In your Hosting Dashboard

Tagged with: , ,