WordPress Visual Editor Fix Repair Re-set Restore From Database

WordPress Visual Editor Fix Repair Re-set Restore – From Database

There can be many reasons why the WordPress visual editor can stop working for yourself, or your users.

In the event that simply changing the setting for the Visual Editor to be “ON” or “OFF” – “visible” or “hidden” – and you would like to change that setting via the WordPress Database – for 1 user or all users – here is how it can be done.

– Search for “rich_editing” in the WordPress Database Table `wp_usermeta`
– browse results.
– find users WHERE `wp_usermeta`.`meta_key` = "rich_editing" AND `meta_value` = "false";

Set values to “true” or “false” to achieve whichever effect you want.

MySQL command to disable rich editing for all users:

UPDATE `wp_usermeta` SET `meta_value` = 'false' WHERE `meta_key` = "rich_editing";

MySQL command to enable rich editing for all users:

UPDATE `wp_usermeta` SET `meta_value` = 'true' WHERE `meta_key` = "rich_editing";

I hope this is helpful.

Have a nice day : )

Multiple Lines For PHP String – Use the concatenation operator – the period

PHP – Sometimes we want to write our strings on Multiple Lines. It is easier to read.
Use the concatenation operator – the period    .      : )

$select_sql =
 "(SELECT nvdtechnical.TECH_Value_Float ".
 "FROM nvdtechnical ".
 "WHERE TECH_TechCode = '11' ".
 "AND nvdtechnical.TECH_Id = capder.cder_ID ".
 "AND nvdtechnical.TECH_Value_Float BETWEEN 40 AND 59 ".
 "LIMIT 1".
 ") as MPG_VALUE ";

[SHORTCODE_Insert_Google_Adsence_Here]

PHP – Use glob() to search for specific file-names in a directory

PHP – Use glob() to search for specific file-names in a directory
/*
Folder with image files contains:

../test_images_folder/21548.JPG
../test_images_folder/21548_1.JPG
../test_images_folder/21548_2.JPG
../test_images_folder/21548_3.JPG
../test_images_folder/21548_4.JPG
../test_images_folder/21548_5.JPG
../test_images_folder/21548_6.JPG
../test_images_folder/22222_5.JPG

*/



$image = "21548";// string to match image file name

foreach(glob("../test_images_folder/*".$image."*") as $filename){

     echo "$filename";

}

/*
Above ‘glob() usage will return:

../test_images_folder/21548.JPG
../test_images_folder/21548_1.JPG
../test_images_folder/21548_2.JPG
../test_images_folder/21548_3.JPG
../test_images_folder/21548_4.JPG
../test_images_folder/21548_5.JPG
../test_images_folder/21548_6.JPG

*/
[SHORTCODE_Insert_Google_Adsence_Here]
 

Regards,

Ken

MySQL said: Incorrect integer value: ” for column ‘your_column’

Later versions of MySQL (my current version MySQL 5.6) will throw an error, if attempting to insert empty (i.e. '') values into a row with INT settings - even with NULL set to "YES"
ERROR: "MySQL said: Incorrect integer value: '' for column 'your_column'"

[SHORTCODE_Insert_Google_Adsence_Here]
You can prevent this error with PHP/MySQL, with a disable of  “STRICT_TRANS_TABLES" - which is triggering the error, on the empty string, you are trying to insert.

$My_Query = " SET SESSION sql_mode= 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; ";
 *No spaces between the commas

Set it back after if you like… Although I belive it is automatically set back.

SET SESSION sql_mode= 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' 


*No spaces between the commas

See what your MySQL says about the current settings via phpMyAdmin:

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;