• Resolved zerozeroseven

    (@allcodeunknown)


    Hello,

    I have a problem with your plugin.

    I have in my article on my blog a code like this:

    `db_cursor.execute(“””
    CREATE TABLE IF NOT EXISTS products (
    name TEXT,
    price REAL,
    description TEXT,
    color TEXT,
    availability INTEGER,
    stock_number INTEGER
    )
    “””)

    db_connection.commit()

    It is in your plugin block (Syntax Highlighter Evolved).

    I noticed that this code executes on my database in meaning it creates a table of products in my DB but it should not do that.

    In WP Activity Log I got a log like:

    “An unknown component created these tables in the database.
    Tables: products”.

    So it means that this code in my article is creating a table in my DB but why?

    Could you write to me why it is behaving like this and how to add SQL code in an article without executing it on WP DB?

    Thank you for your help.

    Have a great day :-).

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support bindlegirl (a11n)

    (@bindlegirl)

    Hi @allcodeunknown !

    That sounds very strange. Do you mean the code executes every time you load the article or when you post it? And when you delete the code, you are no longer seeing the new table getting created?

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Hello @bindlegirl.

    Thank you for your response.

    Yes, that is exactly what is happening.

    These SQL statements execute every time when I update a post or load this post in the admin panel.

    I tried to change the name of this variable db_cursor for something else but it didn’t help.

    When I deleted this code of creating this table there were no additional logs of this sort.

    Is there any way to fix that?

    Thank you for your help.

    Have a great day :-).

    Plugin Author Giannis (a11n)

    (@gikaragia)

    Hello @allcodeunknown,

    which version of the plugin and WordPress do you use? Are you adding the code snippet using blocks or shortcode?

    I have added the snippet both a block snippet and a shortcode and no table is added to the database.

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Hello @gikaragia.

    Thank you for your answer.

    I am using the WP version:

    Current version: 5.8.1

    And Syntax Highlighter Evolved version:

    Version 3.6.0

    I always add code to articles using blocks.

    Is there any way to fix that problem?

    Thank you for your help.

    Plugin Author Renatho (a11n)

    (@renathoc)

    Hi @allcodeunknown !

    I tried to reproduce the issue, but I wasn’t able to as well. Could you try to make a test if you can reproduce it in an environment only with the SyntaxHighlighter Evolved installed? Or you could also try to disable other plugins on your site and confirm if the issue persists.

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Hello @renathoc,

    I will do that. Just give me a few days.

    I will post my results.

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Hello,

    I tried to debug a bit today this problem but without any results.
    I will try to debug that more tomorrow.

    Thank you for your help.

    Have a great day :-).

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Hello,

    I am still fixing this problem. Please give me more time. I will post my results soon on this topic so please don’t close it.

    By the way, I switched the plugin to Prismatric and there is the same problem.

    Thank you for your help.

    Have a great day :-).

    Plugin Support Jay

    (@bluejay77)

    Hi @allcodeunknown,

    Thanks for the update! 🙂 We’ll keep this thread open.

    Please note, that even if the thread is resolved in the future, if you have any further questions or need some more help, you can reply in the same thread, or open another thread citing the thread’s URL 🙂

    Thread Starter zerozeroseven

    (@allcodeunknown)

    Thank you @bluejay77 :-).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘SQL statements in article executes on DB.’ is closed to new replies.