Instead of MAMP I use Vagrant to set up my virtualhosts locally. That way you can emulate your webserver's setup. To configure my Vagrant virtual machine I use PuPHPet. You need to have VirtualBox installed for this. After downloading the PuPHPet configuration manifest you need to start up the virtual box. You do this by executing … Lees verder Vagrant up errors on install on Mac OS X
Categorie: MySQL
Running database queries in WordPress
WordPress has a built-in object class for dealing with database queries. It's called wpdb and it's found in the includes/wp-db.php file. When you're running queries you should always use this class to execute them. To use this class you first need to define $wpdb as a global variable before you can use it. Just place … Lees verder Running database queries in WordPress
Change login session time for PHPMyAdmin
To change the time when your login session gets expired go to the root of your phpmyadmin folder and find the file config.inc.php Now search for this variable -> $cfg['LoginCookieValidity'] In my example I changed it to 5 hours. You should also check the session.gc_maxlifetime in you php.ini file. The lowest value of those two will be in … Lees verder Change login session time for PHPMyAdmin
Resetting the auto increment number with MySQL
Execute this SQL and just replace table_name with the table you want to reset. ALTER TABLE table_name AUTO_INCREMENT=0
Duplicate a database table with MySQL
Just replace the new_table with the name of your new table and existing_table with the table you want to duplicate CREATE TABLE new_table SELECT * FROM existing_table
MySQL replace function – Find and replace values in database with sql
A great piece of sql that can save you a lot of time. The replace sql function finds and replaces values in a database. Just fill in the table_name, table_field, the value your searching for and with which value you want to replace it with. UPDATE table_name SET table_field = REPLACE(table_field, 'value', 'new_value') WHERE my_field … Lees verder MySQL replace function – Find and replace values in database with sql