Ok, ale jak zrobiłem tak to pisze, ze nie zdefiniowana zmienna. Dokładanie tak to wygląda: Co teraz znowu jest źle, nie wiem.
Cytat
Notice: Undefined variable: stmt in C:\Program Files\WebServ\httpd-users\test\trial\sign.php on line 14
Fatal error: Call to a member function bindvalue() on a non-object in C:\Program Files\WebServ\httpd-users\test\trial\sign.php on line 14
<?php
class show {
public $name;
public function get() {
$pdo= new PDO('mysql:host=localhost;dbname=trial', 'root', 'mentormiszcz1e');
$this-> stmt= $pdo -> prepare('SELECT nick,password FROM things WHERE id=:id');
$stmt-> bindvalue (':id', PDO::PARAM_STR);
$stmt-> execute();
$stmt-> closeCursor();
} // end get();
public function showz($name) {
while ($row= $stmt-> fetch()) {
$this-> name= $row['nick'];
return $this->name;
}
}
} // end class
$show= new show;
$show-> get();
?>