Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

help w/procedure


  • Please log in to reply
3 replies to this topic

#1 12Strings

12Strings

  • Members
  • 41 posts
  • OFFLINE
  •  
  • Local time:05:09 PM

Posted 03 September 2014 - 11:15 AM

I'm coding up a billing doc. If an account# owes for several purchases this month,
I want to print one page (consolidate multiple invoices) per account number?
What is the most effective way to approach this (PHP)? a way to compare acct#.



BC AdBot (Login to Remove)

 


#2 neilbuddy

neilbuddy

  • Members
  • 42 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Rochester MN
  • Local time:05:09 PM

Posted 03 September 2014 - 11:38 AM

Are you storing the data in MySQL database for the invoices?  The way I would do it is have an invoice table and and invoice_row table.  Each invoice would be able to have multiple rows that define the purchases.  Then when printing you could print one or many invoices by getting the invoice rows and adding them up on a single page.



#3 12Strings

12Strings
  • Topic Starter

  • Members
  • 41 posts
  • OFFLINE
  •  
  • Local time:05:09 PM

Posted 03 September 2014 - 02:28 PM

Thanks for the response. . not sure what you're saying. The data is in a database table, Executing the doc prints a page for each row so if there are multiple records for the same guy .....in the DP days the various languages had a key to indicate a new index. This is just a pastime. I'm thinking like a dinosaur but I'm thinking PHP must have  a function to preclude comparisons & counters?



#4 neilbuddy

neilbuddy

  • Members
  • 42 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Rochester MN
  • Local time:05:09 PM

Posted 03 September 2014 - 02:39 PM

There is the function mysql_insert_id() which returns the index of the last inserted row.  If you have a database scheme you could post I could get a better idea






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users