Title: SQL Backup without quotes
Last modified: August 21, 2016

---

# SQL Backup without quotes

 *  Resolved [mikek70](https://wordpress.org/support/users/mikek70/)
 * (@mikek70)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/sql-backup-without-quotes/)
 * 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/](https://wordpress.org/plugins/backup-scheduler/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Sed Lex](https://wordpress.org/support/users/sedlex/)
 * (@sedlex)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/sql-backup-without-quotes/#post-5077701)
 * 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](https://wordpress.org/support/users/sedlex/)
 * (@sedlex)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/sql-backup-without-quotes/#post-5077709)
 * 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](https://wordpress.org/support/users/sedlex/)
 * (@sedlex)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/sql-backup-without-quotes/#post-5077925)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/backup-scheduler_f8f7f7.svg)
 * [Backup Scheduler](https://wordpress.org/plugins/backup-scheduler/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/backup-scheduler/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/backup-scheduler/)
 * [Active Topics](https://wordpress.org/support/plugin/backup-scheduler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/backup-scheduler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/backup-scheduler/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Sed Lex](https://wordpress.org/support/users/sedlex/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/sql-backup-without-quotes/#post-5077925)
 * Status: resolved