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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:23:01+00:00 2026-05-14T19:23:01+00:00

I am testing Paypal’s masspay using their ‘ MassPay NVP example ‘ and I

  • 0

I am testing Paypal’s masspay using their ‘MassPay NVP example‘ and I having difficulty trying to amend the code so inputs data from my MySql database.

Basically I have user table in MySql which contains email address, status of payment (paid,unpaid) and balance.

CREATE TABLE `users` (
  `user_id` int(10) unsigned NOT NULL auto_increment,
  `email` varchar(100) collate latin1_general_ci NOT NULL,
  `status` enum('unpaid','paid') collate latin1_general_ci NOT NULL default 'unpaid',
  `balance` int(10) NOT NULL default '0',
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci

Data :

1   test1@example.net   paid    100
2   test2@example.net   unpaid  11
3   test3@example.net   unpaid  20
4   test4@example.net   unpaid  1
5   test5@example.net   unpaid  20
6   test6@example.net   unpaid  15

I then have created a query which selects users with an unpaid balance of $10 and above :

  $conn = db_connect();
  $query=$conn->query("SELECT * from users WHERE 
                       balance >='10'
                       AND status = ('unpaid')"); 

What I would like to is for each record returned from the query for it to populate the code below:

Now the code which I believe I need to amend is as follows:

    for($i = 0; $i < 3; $i++) {
    $receiverData = array(  'receiverEmail' => "user$i@paypal.com",
                            'amount' => "example_amount",);
    $receiversArray[$i] = $receiverData;
}

However I just can’t get it to work, I have tried using mysqli_fetch_array and then replaced “user$i@paypal.com” with $row[’email’] and “example_amount” with row[‘balance’] in various methods of coding but it doesn’t work. Also I need it to loop to however many rows that were retrieved from the query as <3 in the for loop above.

So the end result I am looking for is for the $nvpStr string to pass with something like this:

$nvpStr = "&EMAILSUBJECT=test&RECEIVERTYPE=EmailAddress&CURRENCYCODE=USD&L_EMAIL0=$test2@example.net&L_Amt=11&L_EMAIL1=$test3@example.net&L_Amt=11&L_EMAIL2=$test3@example.net&L_Amt=20&L_EMAIL3=$test5@example.net&L_Amt=20&L_EMAIL0=$test6@example.net&L_Amt=15";

Thanks

  • 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-14T19:23:01+00:00Added an answer on May 14, 2026 at 7:23 pm

    I have resolved the issue after some trial and error:

       <?php
         $nvpStr="&EMAILSUBJECT=$emailSubject&RECEIVERTYPE=$receiverType&CURRENCYCODE=$currency";   
    
    $conn = db_connect();
      $query=$conn->query("SELECT email,balance from users WHERE 
                           balance >='10'
                           AND status = ('unpaid')");
    $i = 0;
      while ($i <= mysqli_fetch_row) {
        while($row = mysqli_fetch_object($query)) { 
          $nvpStr.="&L_EMAIL$i=$row->email&L_Amt$i=$row->balance"; 
          $i++;    
    }
    }
    
        ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 383k
  • Answers 383k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You mean like this? CREATE PROCEDURE [dbo].[Fishes_FullTextSearch] @searchtext nvarchar(4000), @limitcount… May 14, 2026 at 10:58 pm
  • Editorial Team
    Editorial Team added an answer Well, the Java exception tells us there is an XML… May 14, 2026 at 10:58 pm
  • Editorial Team
    Editorial Team added an answer Under the [MySQL] section of your php.ini, set this value:… May 14, 2026 at 10:58 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.