Differences

This shows you the differences between two versions of the page.

Link to this comparison view

programmieren:wordpress:datenbank_tabellen_erzeugen_bei_plugin_aktivierung [2023/06/15 15:44] – created jgehrkeprogrammieren:wordpress:datenbank_tabellen_erzeugen_bei_plugin_aktivierung [2023/06/15 15:45] (current) – [Zweite File mit Datenbank Code] jgehrke
Line 45: Line 45:
  *  *
  */  */
- 
-namespace moewe_marketo_connect; 
  
 class PluginActivator { class PluginActivator {
Line 62: Line 60:
  
  /**  /**
- * Erzeugt eine Tabelle für die Marketo Tokens als Cache+ * Erzeugt eine Tabelle bei Plugin-Aktivierung
  */  */
  public static function create_custom_db_table()  public static function create_custom_db_table()
Line 76: Line 74:
  $sql = "CREATE TABLE $table_name (  $sql = "CREATE TABLE $table_name (
  id mediumint(9) NOT NULL AUTO_INCREMENT,  id mediumint(9) NOT NULL AUTO_INCREMENT,
- mein_text_wert TINYTEXT NOT NULL, + mein_text_werte TINYTEXT NOT NULL, 
- mein_zaheln_wert INT NOT NULL,+ mein_zahlen_werte INT NOT NULL,
  PRIMARY KEY  (id)  PRIMARY KEY  (id)
    ) $charset_collate;";    ) $charset_collate;";
  
- $result = dbDelta( $sql );+ $result = dbDelta( $sql ); // $result speichert nur ob es geklappt hat oder nicht
  }  }
  

Page Tools