SQL statements in article executes on DB.
-
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 :-).
- The topic ‘SQL statements in article executes on DB.’ is closed to new replies.