A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4751

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

DBHelper - mcpaste

DBHelper

Von MC_J, 9 Jahre vorher, geschrieben in Java, aufgerufen 1'459 mal.
URL https://mcpaste.de/view/1c00101d Einbetten
Paste herunterladen oder Rohtext anzeigen
  1.    /**
  2.      * @param m Model
  3.      */
  4.     public Model saveModel(Model m) {
  5.         int id = m.getId();
  6.  
  7.  
  8.  
  9.         if (id < 0){
  10.  
  11.             // Create the Entry in the Database
  12.  
  13.             long insertId = this.getWritableDatabase().insert(m.getTableName(), null, m.getValues());
  14.  
  15.             int newId = (int) insertId;
  16.  
  17.             m.setId(newId);
  18.  
  19.             return m;
  20.  
  21.         }else{
  22.  
  23.             String where = m.getTableName() + ".id = '?'";
  24.  
  25.             String[] args = new String[] {String.valueOf(m.getId())};
  26.  
  27.             this.getWritableDatabase().update(m.getTableName(), m.getValues(), where, args);
  28.  
  29.             return m;
  30.         }
  31.  
  32.     }
  33.  
  34.  
  35.     /**
  36.      * @param m Model
  37.      * @throws Exception
  38.      */
  39.     public void deleteModel(Model m) throws Exception {
  40.         int id = m.getId();
  41.  
  42.         if(id < 1){
  43.            throw new Exception("You cannot delete a player that does not exist!");
  44.         }
  45.  
  46.         String where = m.getTableName() + ".id = '?'";
  47.  
  48.         String[] args = new String[] {String.valueOf(m.getId())};
  49.  
  50.         this.getWritableDatabase().delete(m.getTableName(), where, args);
  51.  
  52.  
  53.     }
  54.  

Antworten auf DBHelper rss

Titel Name Sprache Wann
Re: DBHelper anonymous java 3 Jahre vorher.
Re: DBHelper anonymous java 3 Jahre vorher.

Antwort auf "DBHelper"

Hier kannst Du auf den Paste von oben antworten

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876