Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 518801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:58:28+00:00 2026-05-13T07:58:28+00:00

I am trying to create events on Facebook using Facebook connect. So far, the

  • 0

I am trying to create events on Facebook using Facebook connect. So far, the

$appapikey = 'my key here';

$facebook = new Facebook($appapikey, 'my secret here');
$user = $facebook->require_login();
$fapi = $facebook->api_client;

if(!$facebook->api_client->users_hasAppPermission('create_event')){
    echo'<script type="text/javascript">window.open("http://www.facebook.com/authorize.php?api_key='.$appapikey.'&v=1.0&ext_perm=create_event", "Permission");</script>';
    echo'<meta http-equiv="refresh" content="0; URL=javascript:history.back();">';
    exit;
}

$event_info = array();
$event_info['name'] = $_POST['name'];
$event_info['category'] = 8;
$event_info['subcategory'] = 36;
$event_info['host'] = 'Me';
$event_info['location'] = $_POST['location'];
$event_info['email'] = $_POST['email'];
$event_info['phone'] = $_POST['phone'];
$event_info['description'] = $_POST['description'];
$event_info['city'] = $_POST['city'];
if($_POST['start_time_ampm'] == 'PM'){
    $_POST['start_time_hour'] = $_POST['start_time_hour'] + 12;
}
if($_POST['end_time_ampm'] == 'PM'){
    $_POST['end_time_hour'] = $_POST['end_time_hour'] + 12;
}

$event_info['start_time'] = mktime($_POST['start_time_hour'],$_POST['start_time_min'],00,$_POST['start_time_month'],$_POST['start_time_day'],$_POST['start_time_year']); //Converts time to UTC
$event_info['end_time'] = mktime($_POST['end_time_hour'],$_POST['end_time_min'],00,$_POST['end_time_month'],$_POST['end_time_day'],$_POST['end_time_year']);



try{
    echo json_encode($_POST);
    $event_id = $fapi->events_create($event_info);
    $sql = "INSERT into events (EventId) values('$event_id')";
    $result = mysql_query($sql) or die("can't select events<br>$sql".mysql_error());
    echo 'Event Created!';
}

This all works fine, but the event_id returned is always the same for different events. When I look in my Facebook account, the event was successfully added, but the id there is totally different. Any idea what I may be doing wrong?

I figured out this issue. It was because my database field was set to an int and unfortunately, the Facebook id’s were too long.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:58:29+00:00Added an answer on May 13, 2026 at 7:58 am

    I figured out this issue. It was because my database field was set to an int and unfortunately, the Facebook id’s were too long. I just had to change the field type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create Facebook based login using Javascript. Once a person clicks
Trying to create a user account in a test. But getting a Object reference
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying to create a sitemap using Linq to Xml, but am getting an
I am trying to create a facebook application, all is working fine except the
I am trying to create an event using Facebooks api. (From a django app)
I have created Facebook pages with an events tab. I am currently trying to
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
Trying to create my first iPhone app that would play back audio. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.