I have a very simple problem that has left me stuck and I was hoping you might be able to spot the error. This method will echo the value but will not return. Can you help me spot the error. The method works perfectly fine but will not return the value. public function get_link_id ($permalink){ $addition = 'WHERE PERMALINKS LIKE "%'.$permalink.'%"'; if ($data = $this->get_data ($this->permalinks_table, '0', '1', $addition)){ $link_id = $data[0]['LINK_UNIQUEID']; return $link_id; }else { return false; } } PHP: External code: $cached_uniqueid = $permalinks_obj->get_link_id ($post_perma); echo $cached_uniqueid; PHP: Thanks...
Strange, the function should return something in any case. If it does not echo anything, probably the function returned false. Echoing true will print 1 but echoing false does not print anything, not even 0. So its likely that $this->get_data(...) call failed.