About 10 results: "mysql_query repo:summitds/bloomsburgpa.org"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
_migrate_database.php in bloomsburgpa.org https://bitbucket.org/summitds/bloomsburgpa.org.git | 535 lines | PHP
  1. 	if ( $old_path != '/' ) { // Used to be a subdomain so we can more safely replace.
  2. 		mysql_query( "UPDATE `" . $destination_db_prefix . "blogs` SET path=REPLACE( path, '" . mysql_real_escape_string( $old_path ) . "', '" . mysql_real_escape_string( $destination_path ) . "') WHERE domain='" . mysql_real_escape_string( $old_domain ) . "' AND path LIKE '" . mysql_real_escape_string( $old_path ) . "%'" );
  3. 	} else { // Used to be in root so much prepend new path.
  4. 		mysql_query( "UPDATE `" . $destination_db_prefix . "blogs` SET path=concat( '" . mysql_real_escape_string( rtrim( $destination_path, '/\\' ) ) . "', path ) WHERE domain='" . mysql_real_escape_string( $old_domain ) . "'" );
  5. 	// Update blog domain for all matching sites.
  6. 	mysql_query( "UPDATE `" . $destination_db_prefix . "blogs` SET domain='" . mysql_real_escape_string( $destination_domain ) . "' WHERE domain='" . mysql_real_escape_string( $old_domain ) . "'" );
  7. 	// Update fileupload_url in options table.
  8. 	mysql_query( "UPDATE `" . $destination_db_prefix . "options` SET option_value='" . mysql_real_escape_string( $wp_upload_url ) . "' WHERE option_name='fileupload_url' LIMIT 1" );
  9. 	// TODO: moved to bottom of this file.
  10. 	//mysql_query( "UPDATE `" . $destination_db_prefix . "options` SET option_name='" . $destination_db_prefix . "user_roles' WHERE option_name LIKE '%_user_roles' LIMIT 1" );
  11. 	// Update upload_path in options table.
  12. 	mysql_query( "UPDATE `" . $destination_db_prefix . "options` SET option_value='" . mysql_real_escape_string( str_replace( $new_url . '/', '', $wp_upload_url_real ) ) . "' WHERE option_name='upload_path' LIMIT 1" );
  13. 	// Update fileupload_url in options table.
  14. 	mysql_query( "UPDATE `" . $destination_db_prefix . "options` SET option_value='" . mysql_real_escape_string( $wp_upload_url ) . "' WHERE option_name='fileupload_url' LIMIT 1" );
  15. 	// TODO: moved to bottom of this file.
  16. 	//mysql_query( "UPDATE `" . $destination_db_prefix . "options` SET option_name='" . $destination_db_prefix . "user_roles' WHERE option_name LIKE '%_user_roles' LIMIT 1" );










Back to Top