• Resolved mikek70

    (@mikek70)


    Tried restoring a backup into a new database, but the INSERT statements are missing the quotes around char or datetime fields and therefore fail…

    Example:

    INSERT INTO wp_blog_versions VALUES(2, 27916, 2014-07-04 16:14:08);
    INSERT INTO wp_blog_versions VALUES(1, 27916, 2014-07-04 16:14:44);
    INSERT INTO wp_blog_versions VALUES(4, 27916, 2014-07-04 16:23:42);
    INSERT INTO wp_blog_versions VALUES(3, 27916, 2014-07-04 16:23:43);

    Am I missing an option or is this a bug?

    https://wordpress.org/plugins/backup-scheduler/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sed Lex

    (@sedlex)

    It is not normal

    Just for your info the code is

    $delimit = "" ;
    if ( ($wpdb->get_col_info('type', $ii) == "string") || ($wpdb->get_col_info('type', $ii) == "blob") || ($wpdb->get_col_info('type', $ii) == "datetime") || ($wpdb->get_col_info('type', $ii) == "date") || ($wpdb->get_col_info('type', $ii) == "timestamp") || ($wpdb->get_col_info('type', $ii) == "time") || ($wpdb->get_col_info('type', $ii) == "year") )
        $delimit .=  "'";

    Then if the field is a datetime field, the field should be between quotes

    Are you able to provide me the result of
    $wpdb->get_col_info('type', $i)
    for your field (with $i the offset of your column with a date ?

    Plugin Author Sed Lex

    (@sedlex)

    Just to be clearer you have to execute the following :

    $wpdb->query('SELECT * FROM wp_blog_versions') ;
    echo "# ".$wpdb->get_col_info('type', 3)."<br/>" ;

    For instance you can put this code in the init method of the plugin

    Plugin Author Sed Lex

    (@sedlex)

    I assume that you solve your problem.

    If not, please recontact me here

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SQL Backup without quotes’ is closed to new replies.