Hallo hab eine pdo klasse(ja ich weiß)pdo ist schon eine klasse)
in dieser klasse gibt es eine function escape string. So wen ich diese function aufrufen möchte sagt er Mir
Er kann die Methode nicht aufrufen finden
Code der Klasse
Irgendwo ist der Wurm drin
in dieser klasse gibt es eine function escape string. So wen ich diese function aufrufen möchte sagt er Mir
Code:
Call to undefined method dbEngine::quote()
Code der Klasse
PHP-Code:
class dbEngine
{
public $dbs;
/**
* PDO verbindung aufbauen *
*/
function _construct($host,$datenbank,$username,$password)
{
try
{
$this->dbs = new PDO ('mysql:host='.$host.'; dbname='.$datenbank,$username,$password,array
(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET CHARACTER SET utf8',
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING
)
);
}
catch (PDOException $e)
{
echo 'Fehler beim Öffnen der Datenbank: ' . $e->getMessage();
}
}
function escape_string($string)
{
$string = $this->quote($string);
// Remove ' from the begginging of the string and at the end of the string, because we already use it in insert_query
$string = substr($string, 1);
$string = substr($string, 0, -1);
return $string;
}
}
Kommentar