What is my error trying to create a new table in the database?

I tried creating the tables in different ways and I always get the same error: "Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘( …… at line 1 of the WordPress database for the CREATE TABLE IF NOT query EXISTS"

    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );          global $  wpdb, $  rs_plugin_db_version, $  table_name_clientes, $  table_name_promociones;          $  charset_collate = $  wpdb->get_charset_collate();          $  wpdb->query(         "CREATE TABLE IF NOT EXISTS $  table_name_clientes (             id int(11) NOT NULL,             logo text NOT NULL,             name text NOT NULL,             whatsapp text DEFAULT '' NOT NULL,             instagram text DEFAULT '' NOT NULL,             facebook text DEFAULT '' NOT NULL,             PRIMARY KEY  (id)         ) $  charset_collate ENGINE = InnoDB"     );     dbDelta();          $  wpdb->query(         "CREATE TABLE IF NOT EXISTS $  table_name_promociones (             id int(11) NOT NULL,             img text NOT NULL,             title text NOT NULL,             content text NOT NULL,             owner int(11) NOT NULL,             contact int(11) NOT NULL,             PRIMARY KEY  (id),             FOREIGN KEY  (owner) REFERENCES $  table_name_clientes(id) ON DELETE CASCADE ON UPDATE CASCADE         ) $  charset_collate ENGINE = InnoDB"     );     dbDelta(); 

In one of the tables I need to create a foreign key, if I didn’t misunderstood dbDelta() does not support them and therefore my last attempt was with $ wpdb->query, but with or without foreign key the result is the same.

maybe my mistake is obvious, but honestly I can’t find it

Defy Danger or Golden Opportunity

In Dungeon World, if the GM describes a hazard and a player disregards it should that trigger the Defy Danger move or be considered a Golden Opportunity that triggers a GM move?

For example:

GM: The swamp beast lurches out of the mist, a mass of grasping, strangling tentacles reaching out to towards anything within reach. What do you do?

Fighter: I run up and hit it with my sword.

Surely that isn’t a simple Hack & Slash. But should it trigger a GM move or a Defy Danger move?

Would it change the answer if the Swamp Beast had the Reach tag but the Fighter’s sword only had the Close tag?

Review of Log Messages Database Schema

so i have been tasked to design a log database and i would appreciate some feedback about my design.

I have an application that consists of three basic parts:

  • A frontend
  • A backend
  • A low level component

Each part can create a log message which needs to be stored in a database. The parts(front end, backend, low level component) that create the log messages should be uniquely identified. At the same time when looking at a message it should be possible to see which part created the message.

Each message has a specific type assigned to it and the type can be one of the following destinct values

  • Error,
  • Warning,
  • Info,
  • Debug

The message itself should also be unique, it should have a text that says what is the problem and possibly also a description with extra information about the problem and under which circumstances it could have happened. In addition the time the message was created is very important. Because of the low level component we need microsecond accuracy.


Message : Pump Failure

Description: The pump is not pumping enough oil. Check the amount of oil and also check the temperature of the system.

Finally there are some extra "requirements" that in my opinion could affect the design of the system: The low level component produces a lot of messages in a short amount of time. This could lead to the database reaching its storage limit relatively fast. In that case the older messages should be deleted first. However there are rules that need to be taken into consideration before deleting a message. An info is less important than a warning and a warning is less important than an error. Another rule is unless I have reached a specific threshold I am not allowed to delete messages of a specific type e.g Only if have more than 500 errors am I allowed to start deleting the older errors.

My current design is the following:

Message     Id (PK)     Name varchar     Description varchar 
MessageType     Id (PK)     Name Varchar 
Sender     Id (PK)     Name Varchar 
MessagesLog     Id (PK)     MessageId (FK)     SenderId (FK)     NotificationTypeId(FK)     Date BigInt 

However taking into consideration these extra requirements and thinking that I will need to do a lot of checking on an application level if certain criteria are fullfiled before i delete a record from the database, i thought about creating a seperate table for each message type:

Message     Id (PK)     Name varchar     Description 
Sender     Id (PK)     Name Varchar 
MessagesLogError     Id (PK)     MessageId (FK)     SenderId (FK)     Date BigInt 
MessagesLogWarning     Id (PK)     MessageId (FK)     SenderId (FK)     Date BigInt 
MessagesLogInfo     Id (PK)     MessageId (FK)     SenderId (FK)     Date BigInt 
MessagesLogDebug     Id (PK)     MessageId (FK)     SenderId (FK)     Date BigInt 

What do you think?

Do I use my druid’s own proficiency bonus for the attacks of their wildshape?

Let’s consider this example: A lvl 12 Druid has a +4 proficiency bonus. They proceed to wild shape into an ape, whose attacks have a +5 bonus to attack rolls, easily calculated to be +3 from its Strength and a +2 proficiency modifier. Does the wildshaped druid attack at +5, or at +7? I’ve seen the first interpretation to be more common but I’d like to know the reasoning for such.

If your target has an enemy within 5ft, can you sneak attack without using a finesse or ranged weapon?

A rogue and fighter are engaged in melee combat with a goblin. The rogue is unarmed. Can the rogue activate Sneak Attack?

The rules for Sneak Attack state:

Beginning at 1st level, you know how to strike subtly and exploit a foe’s distraction. Once per turn, you can deal an extra 1d6 damage to one creature you hit with an attack if you have advantage on the attack roll. The attack must use a finesse or a ranged weapon.

You don’t need advantage on the attack roll if another enemy of the target is within 5 feet of it, that enemy isn’t incapacitated, and you don’t have disadvantage on the attack roll.

The question arises from the difficulty in parsing the bolded sentence. I have heard 2 interpretations:

  1. You can sneak attack if (you have advantage and the attack is made using a finesse or ranged weapon) or (an enemy of the target is within 5ft, etc).
  2. You can sneak attack if ((you have advantage) or (an enemy of the target is within 5ft, etc)) and the attack is made using a finesse or ranged weapon.

The first interpretation hinges on the idea that when the second paragraph says "on the attack roll" it is still talking about the same "attack" as in the first paragraph. The second interpretation hinges on the idea that the first interpretation is bizarre and unnatural – if that was the intent, there are many ways that it could have been worded to be clearer.

Thematically, I am leaning towards the first – not having a finesse or ranged weapon shouldn’t stop the rogue from exploiting a distracted foe.

Considering RAW only (no twitter please), how should this feature be interpreted?

Creating Conditional Fields in Elementor Custom Widget

How are conditional fields or field groups created in Elementor? I’ve not found anything in the documentation regarding conditional fields for widget development. A simple example of what I’d like to do is the following:

I have a dropdown:

    // Select Control     $  this->add_control(         'dropdown_Example',         [             'label' => __('Dropdown Example', 'vs'),             'type' => \Elementor\Controls_Manager::SELECT,             'options' => [                 'default' => __('Default', 'vs'),                 'yes' => __('Yes', 'vs'),                 'no' => __('No', 'vs'),             ],             'default' => 'default',         ]     ); 

If the answer in the dropdown is yes, then show text field 1:

    // Text 1     $  this->add_control(         'text1',         [             'label' => __('Text1', 'vs'),             'type' => Controls_Manager::TEXT,         ]     ); 

Else, show text field 2:

    // Text 2     $  this->add_control(         'text2',         [             'label' => __('Text2', 'vs'),             'type' => Controls_Manager::TEXT,         ]     );