Hey guys, here's the error today!
switch($this->_getParam('application-action')) {
case 'approve':
if ($ride->ride_spaces_available == $ride->ride_spaces_taken) {
$this->_helper->getHelper('FlashMessenger')->addMessage('All available spaces have been taken. If you want to approve this user, you must remove another user.', 'notice');
}
else {
// Make sure the ride isn't full
$ride->ride_spaces_taken++;
$ride->save();
$application->current()->application_changed = time();
$application->current()->application_status = Application::APPLICATION_STATUS_APPROVED;
$user = $users->find($application->current()->application_user_id)->current();
$this->view->ride = $ride;
$this->view->user = $user;
What happens is, the ride_spaces_avaliable equals 2 and the ride_spaces_taken equals 0, yet it is still giving me the "All available spaces have been taken. If you want to approve this user, you must remove another user" error, even though they are no way equal. It is obviously taking the values from mysql, which I have checked and equal 2 and 0 respectively. Btw, I am using Zend Framework
Any help would be greatly appreciated