为什么这个数据库查询失败?在我的 CentOS 中。
错误/异常:
"Notice: Undefined variable: table in /var/www/html/-manager/application/controllers/IndexController.php on line 37 Fatal error: Call to a member function getAdapter() on a non-object in /var/www/html/-manager/application/controllers/IndexController.php on line 37 Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
磁盘空间?:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_demo-lv_root
50G 47G 0 100% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 485M 47M 413M 11% /boot
/dev/mapper/vg_demo-lv_home
170G 200M 161G 1% /home
调用为:
$rows = new Application_Model_Clients(); // PASS
$dbsession = $rows->give_sessions("test"); // FAILS
库存为:
mysql> select username,password from sh_operator;
+----------+----------+
| username | password |
+----------+----------+
| test | 1234567 |
+----------+----------+
1 rows in set (0.00 sec)
mysql>
<?php
class Application_Model_Clients extends Zend_Db_Table {
protected $_name = 'web145-mydb.sh_operator';
public function addRecord($post) {
$encrypted = mt_rand();
$value = array(
'email' => $post->email,
);
return $this->insert($value);
}
public function search($zip) {
$result = $this->fetchRow("zip =" . $zip);
return $result->toArray();
}
public function give_sessions($input) {
Zend_Debug::dump($input); // PASS test
echo "alive 0 "; // PASS
$result = $this->fetchRow("username ='" . $input . "'");
echo "alive 1 "; // fails
exit;
return $result->toArray();
}
}
?>