Title: Fehler
Last modified: January 2, 2022

---

# Fehler

 *  Resolved [edmundh](https://wordpress.org/support/users/edmundh/)
 * (@edmundh)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/fehler-4/)
 * kann mir jemand helfen
 * Fatal error: Uncaught mysqli_sql_exception: Duplicate entry ‘AF’ for key ‘country_2_code’
   in /hp/aa/ak/ds/www/bistro/wp-includes/wp-db.php:2056 Stack trace: #0 /hp/aa/
   ak/ds/www/bistro/wp-includes/wp-db.php(2056): mysqli_query(Object(mysqli), ‘INSERT
   INTO `zx...') #1 /hp/aa/ak/ds/www/bistro/wp-includes/wp-db.php(1945): wpdb->_do_query('
   INSERT INTO`zx…’) #2 /hp/aa/ak/ds/www/bistro/wp-content/plugins/vikrestaurants/
   libraries/adapter/database/database.php(260): wpdb->query(‘INSERT INTO `zx…’)#
   3 /hp/aa/ak/ds/www/bistro/wp-content/plugins/vikrestaurants/libraries/update/
   manager.php(652): JDatabase->execute() #4 /hp/aa/ak/ds/www/bistro/wp-content/
   plugins/vikrestaurants/libraries/update/manager.php(53): VikRestaurantsUpdateManager::
   execSqlFile(‘/hp/aa/ak/ds/ww…’) #5 /hp/aa/ak/ds/www/bistro/wp-content/plugins/
   vikrestaurants/libraries/system/install.php(71): VikRestaurantsUpdateManager::
   install() #6 /hp/aa/ak/ds/www/bistro/wp-includes/class-wp-hook.php(303): VikRestaurantsInstaller::
   activate(”) #7 /hp/aa/ak/ds/www/bistro/wp-includes/class-wp-hook.php(327): WP_Hook-
   >apply_filters(”, Array) #8 /hp/aa/ak/ds/www/bistro/wp-includes/plugin.php(470):
   WP_Hook->do_action(Array) #9 /hp/aa/ak/ds/www/bistro/wp-admin/plugins.php(193):
   do_action(‘activate_vikres…’) #10 {main} thrown in /hp/aa/ak/ds/www/bistro/wp-
   includes/wp-db.php on line 2056
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffehler-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/)
 * (@e4jvikwp)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/fehler-4/#post-15212135)
 * Hi,
 * if you are getting this issue, probably something went wrong during the installation
   of the program, which failed after creating the database tables.
 * Surely this is a really weird issue, that you can only solve by truncating the
   tables that do not allow records sharing the same key:
 * So, you need to open your MySQL panel and launch the following SQL commands:
 * `TRUNCATE TABLE #__vikappointments_countries`
    `TRUNCATE TABLE #__vikappointments_config`
 * Remember to replace `#__` with the real prefix used by your database, which should
   start with “zx”, as we can read from the attached error message.
 * Once the tables have been emptied, you should retry to install the program.
 * Should the problem persists, we may need to access your website to check what’s
   causing the failure during the installation of our plugin. For this reason, we
   kindly ask you to reach us through our website [https://vikwp.com/contact-us](https://vikwp.com/contact-us).
    -  This reply was modified 4 years, 5 months ago by [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/).
 *  Plugin Author [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/)
 * (@e4jvikwp)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/fehler-4/#post-15215288)
 * For those who might face the same behavior, the tables mentioned in the previous
   message were not correct, as they were referring to a different plugin. These
   are the correct ones:
 * `TRUNCATE TABLE #__vikrestaurants_countries`
    `TRUNCATE TABLE #__vikrestaurants_config`
 * I also have to report that this was not enough to solve the issue reported by
   [@edmundh](https://wordpress.org/support/users/edmundh/), because its PHP installation
   is handling `static` variables in an unusual way. A manual intervention was need
   to make it working.
 *  Thread Starter [edmundh](https://wordpress.org/support/users/edmundh/)
 * (@edmundh)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fehler-4/#post-15275618)
 * Hallo
    Können sie mir sagen was sie genau gemacht haben? weil ich die Seite neu
   aufgesetzt habe und das gleiche Problem wieder da ist. mein Anbieter sagt es 
   liegt an dem Plugin
 *  Plugin Author [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/)
 * (@e4jvikwp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fehler-4/#post-15275743)
 * Hello,
 * did you try to install VikRestaurants on a different domain? Or did you install
   it on the same one?
 * If you are under the same domain, with the same hosting company, the problem 
   raised during the installation of VikRestaurants must be related to your PHP 
   installation.
 * I cannot explain what I did, because I edited several lines of code to make sure
   that the involved blocks of code were not executed during the installation.
 * As we discussed on our private conversation, your PHP installation were handling
   static methods and variables in an uncommon way. Static variables CANNOT be shared
   between 2 objects with different class.
 * As long as PHP behaves in this way, the program won’t be able to properly work.
 * Did your hosting provider check the test file that I left on your website?
 *  Thread Starter [edmundh](https://wordpress.org/support/users/edmundh/)
 * (@edmundh)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fehler-4/#post-15279753)
 * Hallo
 * der hosting provider sagt es liegt an dem Plugin
    er währe nicht dafür zuständig
 *  Plugin Author [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/)
 * (@e4jvikwp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fehler-4/#post-15283600)
 * Hello,
 * I noticed that the issue related to the static variables seems to be fixed now.
   Also VikRestaurants seems to properly work.
 * Please, can you confirm it?

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

The topic ‘Fehler’ is closed to new replies.

 * ![](https://ps.w.org/vikrestaurants/assets/icon-256x256.png?rev=2426639)
 * [VikRestaurants Table Reservations and Take-Away](https://wordpress.org/plugins/vikrestaurants/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/vikrestaurants/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/vikrestaurants/)
 * [Active Topics](https://wordpress.org/support/plugin/vikrestaurants/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/vikrestaurants/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/vikrestaurants/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [e4jvikwp](https://wordpress.org/support/users/e4jvikwp/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/fehler-4/#post-15283600)
 * Status: resolved