I've one file having a form, which includes another to procedure that form. The file using the form calls a function within the incorporated file to create data towards the database, after which I return an $place_id from that publish in order to reference it within the output.

For instance, whenever you complete the shape around the page, the information is distributed towards the db from the separate file, then I wish to reference the ID it had been succumbed the initial file which i known as the function from.

A snippet from the file using the form which includes the db process file:

if (isset($_POST['EC_doPost']))
    $statusPost = $_POST['EC_statusPost'];

    echo "HERE: " . $this->addEvent($title, $location, $linkout, $attendees, $description, $startDate, $startTime, $endDate, $endTime, $accessLevel, $postID) . "There.";

    $data = array
    	'post_content' => $output . "TESTING THIS: " . $event_id,
    	'post_title' => $title,
    	'post_date' => date('Y-m-d H:i:s'),
    	'post_category' => $wpdb->escape($this->blog_post_author),
    	'post_status' => $statusPost,
    	'post_author' => $wpdb->escape($this->blog_post_author),

Here is s the function (within the incorporated file) which should return the place_id:

function addEvent($title, $location, $linkout, $attendees, $description, $startDate, $startTime, $endDate, $endTime, $accessLevel, $postID)
    $postID = is_null($postID) ? "NULL" : "'$postID'";
    $location = is_null($location) ? "NULL" : "'$location'";
    $description = is_null($description) ? "NULL" : "'$description'";
    $startDate = is_null($startDate) ? "NULL" : "'$startDate'";
    $endDate = is_null($endDate) ? "NULL" : "'$endDate'";
    $linkout = is_null($linkout) ? "NULL" : "'$linkout'";
    $attendees = is_null($attendees) ? "NULL" : "'$attendees'";
    $startTime = is_null($startTime) ? "NULL" : "'$startTime'";
    $accessLevel = is_null($accessLevel) ? "NULL" : "'$accessLevel'";
    $endTime = is_null($endTime) ? "NULL" : "'$endTime'";

    $sql = "INSERT INTO `$this->mainTable` (`id`, `eventTitle`, `eventDescription`, `eventLocation`, `eventLinkout`, `eventAttendees`,`eventStartDate`, `eventStartTime`, `eventEndDate`, `eventEndTime`, `accessLevel`, `postID`) VALUES (NULL , '$title', $description, $location, $linkout, $attendees, $startDate, $startTime, $endDate, $endTime , $accessLevel, $postID);";


    $landingpage = "'http://www.google.com'";
    $status = "'1'";
    $title = "'".$title."'";
    $addedon = "'".date("Y-m-d")."'";

    $sql = "INSERT INTO `$this->eventrTable` (`name`, `description`, `event_date`, `maximum_attendees`, `added_on`, `status`, `landing_page`) VALUES ($title, $description, $startDate, $attendees, $addedon, $status, $landingpage);"; 

    $event_id = $this->db->insert_id;

    return $event_id;

Things I am attempting to do is make two Wordpress plug ins interact, but it is not going very well at this time. Basically result in the incorporated file using the function echo the variable, it really works, however I can not get results within the original file...

I am sure it is something dumb, but I am stumped.

The addEvent() function isn't coming back the $event_id

You ought to have something similar to this:

function addEvent(/*...*/)
    // ...

    $sql = "INSERT INTO `$this->eventrTable` ("
      ."`name`, `description`, `event_date`, `maximum_attendees`, `added_on`, `status`, `landing_page`) "
      ."VALUES ($title, $description, $startDate, $attendees, $addedon, $status, $landingpage);";

    $event_id = $this->db->insert_id;

    return $event_id;

Try doing the next:


And publish the output.