Backup Scheduler
[resolved] SQL Backup without quotes (4 posts)

  1. mikek70
    Posted 2 years ago #

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


    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?


  2. Sed Lex
    Plugin Author

    Posted 2 years ago #

    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 ?

  3. Sed Lex
    Plugin Author

    Posted 2 years ago #

    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

  4. Sed Lex
    Plugin Author

    Posted 1 year ago #

    I assume that you solve your problem.

    If not, please recontact me here

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Backup Scheduler
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.