• Resolved lordandy1984

    (@lordandy1984)


    Hi,

    when creating a new quiz, it seems the code tries to insert a “0” into an auto_increment field.
    And then the quiz itself also does not get an ID and I cannot use it.
    Anything I can fix here or change? My Page is running using PHP7.2

    Regards,
    Andy

    Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO wp_asq_personalities (personality_id, personality_guid, quiz_id, personality_title, personality_content, image_id, personality_order) VALUES (‘0’, ‘e7f5331a-65d3-45dd-a29a-*****’, ‘0’, ‘TEWI oder WIWI’, ”, ”, ‘1’) von do_action(‘admin_page_ari-stream-quiz-quiz’), WP_Hook->do_action, WP_Hook->apply_filters, Ari\App\Plugin->__call, Ari_Stream_Quiz\Controllers\Quiz\Save->execute, Ari_Stream_Quiz\Models\Quiz->save, Ari_Stream_Quiz\Entities\Quiz_Personality->store, Ari\Entities\Entity->store

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

    (@arisoft)

    Hello

    It is normally to use NULL or 0 value for auto increment column in MySQL database. 0 will not work only if NO_AUTO_VALUE_ON_ZERO sql mode is enabled, but it is not recommended more.

    Could you execute the following queries on your DB to check what sql modes are used:

    SELECT @@GLOBAL.sql_mode

    SELECT @@SESSION.sql_mode

    Thread Starter lordandy1984

    (@lordandy1984)

    Hello @arisoft,

    you’re right, in my modes there is a NO_AUTO_VALUE_ON_ZERO.

    As I don’t know what changing this has global effects as I run dozens of applications and also WordPress on this database, I will set it just for this session and check if it works.

    Regards,
    Andy

    Thread Starter lordandy1984

    (@lordandy1984)

    Hi @arisoft,

    I can confirm, after removing the NO_AUTO_VALUE_ON_ZERO it is working.

    Regards,
    Andy

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Database Error on new ARI PRO Quiz’ is closed to new replies.