• Resolved damiantk

    (@damiantk)


    After one of the updates, an error with the text

    [Unknown column 'new' in 'where clause']
    SELECT * FROM wp_aioseo_notifications WHERE 1 = 1 AND <code>dismissed</code> = 0 AND <code>new</code> = 1

    appeared in wp-admin.
    I found in app/Common/Main/Updates.php file, lines 180+, you are creating aioseo_notifications table without column “new”, but in app/Common/Models/Notification.php you are using “new” in where clause.
    Is this the cause of the error message Im getting?

Viewing 1 replies (of 1 total)
  • Naveen Kharwar

    (@naveenkharwar)

    Hi @damiantk,

    Thank you for reporting the issue.

    Can you please add the below code on your website using the Code Snippet plugin? After adding the code, refresh your WordPress Dashboard and it will fix the problem for you.

    add_action( 'admin_init', 'aioseo_add_notification_new_column' );
    function aioseo_add_notification_new_column() {
    	if ( ! method_exists( 'AIOSEO\Plugin\Common\Main\Updates', 'addNotificationsNewColumn' ) || ! method_exists( 'AIOSEO\Plugin\Common\Utils\Database', 'columnExists' ) ) {
    		return;
    	}
    	if ( ! aioseo()->db->columnExists( 'aioseo_notifications', 'new' ) ) {
    		aioseo()->updates->addNotificationsNewColumn();
    	}
    }

    Please note, you don’t need to keep this code on your site so after refreshing your dashboard please remove it.

    If this doesn’t fix the problem, contact us from our website using the form below and we can take a closer look:

    https://aioseo.com/contact/

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Database missing column ‘new’’ is closed to new replies.