Why this database query failing? in my CentOS.
Error/Exception:
"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
Disk space?:
$ 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
Calling as:
$rows = new Application_Model_Clients(); // PASS
$dbsession = $rows->give_sessions("test"); // FAILS
Stocked as:
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();
}
}
?>
For a database name with “-“, you may need to use backticks to assign it to the adaptor correctly.
The exception shows that you do not have disk space left. Clear up some space, that should solve the issue.