Archive | PHP RSS feed for this section

How to Add a User to a WordPress Multisite Via Database as an Administrator

A while back we were given permission to host and edit a clients’ website, built on WordPress with Multisite functionality. However, for various reasons we were unable to get in touch with the previous developer who had Admin access to the sites. Since we were hosting their website and database, we at least had that. [...]

Get-Simple CMS – A Non-MySQL, XML Data-Based Content Management System (CMS)

I have been using WordPress for building most of my websites and plan to continue doing so. It has become a very robust platform that can do many things. However, I find that with the robustness, WordPress can bog down the page load time on a shared hosting server, especially on Godaddy. The requirements on [...]

Solution to Annoying WordPress Error Warning: Invalid argument supplied for foreach() wp-includes/query.php on line 2762

Initial post by Blackspotradish, this saved me hours of frustration! This was an annoying bug on one of my wordpress + buddypress for a while and the fix is amazingly simple : Edit your wp-includes/query.php around line 2762 // Always sanitize foreach ( $this->posts as $i => $post ) { $this->posts[$i] = sanitize_post( $post, ‘raw’ [...]

How to Install & Setup WordPress Multisite

Since version 3.0, you  had the option to activate “WordPress Multisite,” which is great considering that it allows you to run as many sites as you want from a single WordPress installation (whereas previously it was one website per WordPress installation). If you run a lot of sites, or you have lots of clients that [...]

How to Set Up Domain Mapping for WordPress Multisite

So you’ve gone through setting up WordPress Multisite, and now you’re ready to start setting up new sites in your network. Only trouble is, you want to use unique domains for your sites instead of using subdomains of your main installation. Well, with a little extra effort, it’s entirely possible. Install the required plugin There’s an excellent plugin [...]

REPLACE: Find and Replace Text in MySQL Database Using SQL

The syntax of REPLACE is REPLACE(text_string, from_string, to_string)

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);

update client_table set company_name = replace(company_name, ‘Old Company’, ‘New Company’)

Another example:


SELECT REPLACE(‘www.mysql.com’, ‘w’, ‘Ww’);

Above statement will return ‘WwWwWw.mysql.com’ as result.

How to Open CakePHP Files in Dreamweaver

Thanks to James Fairhurst on this. I primarily use Adobe Dreamweaver to create and code all of my websites, mainly because of the code highlighting and the way I organise my sites in separate folders. I realise that there are loads of text editors out there but Dreamweaver is what I’m comfortable with and it [...]

Drupal – Restore Your Password for 6 and 7

“Help!!! I need the admin password for a Drupal site!!!” Some people who get a Drupal site to test from their end don’t get password access. Here are a couple of ways to change a password. Drupal 6 and 7 Update the email field for the admin user (user 1) in the “users” table. Unlike [...]