Jump to content

Cannot get data out of an array


lordzardeck

Recommended Posts

For some reason I cannot get the duedate out of the $item_curculation array. Can someone please help me?!?!?!

 

$item_circulation = self::get_circulation($itemid); 
$item_row['duedate'] = $item_circulation['duedate'];
return $item_row;

function get_circulation($itemid){
      
          $sql = "SELECT * FROM `circulation` WHERE itemid = $itemid";
          $query = self::$db->query($sql);
          $row = self::$db->fetch_row($query);
          $patronid = $row['patronid'];
          if($patronid){
          $patron_sql = "SELECT * FROM `patron` WHERE patronid = $patronid";
          $patron_query = self::$db->query($patron_sql);
          $patron_row = self::$db->fetch_row($patron_query);}
          $circulation['patronname'] = $patron_row['firstname']." ".$patron_row['lastname'];
          $circulation['patroncard'] = $patron_row['cardnumber'];
          $curculation['duedate'] = $row['datedue'];
          
          return $circulation ;
      
      }

when I echo $curculation['duedate'] I get a result, but outside the function I get nothing.

Link to comment
https://forums.phpfreaks.com/topic/151661-cannot-get-data-out-of-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.