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 8373495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:41:19+00:00 2026-06-09T14:41:19+00:00

i need to post multiple message to facebook wall from the mysql database. first

  • 0

i need to post multiple message to facebook wall from the mysql database. first i fetch the data from mysql and put it in while loop

while($row=mysql_fetch_array($result))
      {

$des=$row[1];
$purpose=$row[3];
$price_sale=$row[4];
$price_rent=$row[5];
$img="example.com/images".mysql_result($result,0,2);


  $attachment =  array(
    'access_token' => "$token",
    'message' => $des,
    'picture' => $img,
    'link' => "example.com"
    );

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/xxxxxxxxxxx/feed');

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  //to suppress the curl output 
$result = curl_exec($ch);
curl_close ($ch);


echo $result;

} 

the $result contain 3 records. But only post the first row. Plz give a solution for this

  • 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-06-09T14:41:20+00:00Added an answer on June 9, 2026 at 2:41 pm

    Try changing the name of the variable that accepts the curl output.You are using the same variable above.

       while($row=mysql_fetch_array($result))
              {
    
        $des=$row[1];
        $purpose=$row[3];
        $price_sale=$row[4];
        $price_rent=$row[5];
        $img="example.com/images".mysql_result($result,0,2);
    
    
          $attachment =  array(
            'access_token' => "$token",
            'message' => $des,
            'picture' => $img,
            'link' => "example.com"
            );
    
        $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/xxxxxxxxxxx/feed');
    
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  //to suppress the curl output 
        $curlresult = curl_exec($ch);
        curl_close ($ch);
    
    
        echo $curlresult;
    
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Facebook's Batch Requests to post to multiple feeds and I need to
Need to load data from a single file with a 100,000+ records into multiple
I need to post message on a certain FB page as a owner by
I've got a form and I need to post data to the server every
If I have the xml/html data to post we need to encode the data
I have a form which I need to POST to multiple scripts. How can
First I need to apologize for the long post, I struggle with being overly
I need get the SVN commit message in post-commit hook bat in Windows, so
I need to post in the background with Greasemonkey. I tried to create an
I need to post a form on a new website which is UTF-8 encoded.

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.