Skip to content

Tag: database

Can I add a base64 image to the $_FILES array?

Is there a way to add a base64 image string to the $_FILES array (the array that you get when you upload a file)? Basically, I want to fake a file upload from a base64 string. The base64 string comes from an email attachment. I don’t wish to use file_get_contents(), because I want to save the image in a datab…

Safely remove migration In Laravel

In Laravel, there appears to be a command for creating a migration, but not removing. Create migration command: If I want to delete the migration, can I just safely delete the corresponding migrations file within the database/migrations folder? Migrations file: Answer I accidentally created a migration with a…

WordPress database error MySQL server has gone away for query

I get this error so frequently that the php_error log file increases 1MB every 2 seconds. and the site is very slow. I have tried to add this line to wp-db.php but it did not help. The web server is IIS 7, latest version of mysql and wordpress Answer This trick will work for all WordPress versions. Open your …