| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 13
|
invoice creation
hi first I'm half way in the development of an invoice system. 1. user logs in then displays the info for that user 2. database displays the records in a table with a while loop 3. here I need to grab any of these records (say 10 records ) and show them in another page to then transfer to paypal and pay. the only problem I have it's to display any of the records in the loop in another page, the rest is already done. Thanks in advance |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 13
|
ok this is the code while ($row = mysql_fetch_array($result, MYSQL_BOTH)){ echo "<tr>"; echo "<th><font size='-5'>"; echo $_SESSION['username'] = ($row['username']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['Cus_ID'] = ($row['Cus_ID']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['WorkOrderNo'] = ($row['WorkOrderNo']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['BusinessName'] = ($row['BusinessName']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['FaultReported'] = ($row['FaultReported']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['amount'] = ($row['0'], $row['amount']); echo "</font></th>"; echo "<th>"; |
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 13
|
sorry this is the code while ($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<th><font size='-5'>"; echo $_SESSION['username'] = ($row['username']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['Cus_ID'] = ($row['Cus_ID']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['WorkOrderNo'] = ($row['WorkOrderNo']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['BusinessName'] = ($row['BusinessName']); echo "</font></th>"; echo "<th><font size='-5'>"; echo $_SESSION['FaultReported'] = ($row['FaultReported']); echo "</font></th>"; echo "<th><font size='-5'><a href='pay_2.php'>"; echo $_SESSION['amount'] = ($row['amount']); echo "</a></font></th>"; echo "<th>"; } Now all I'm getting is the last result of the loop in the next page and I can't figure out how to access the data that was read before |
|
|
|
#8 (permalink) |
|
geek
|
Try something like this. dump all the rows into an array $data_for_another_page=array(); while ($row = mysql_fetch_array($result)){ $data_for_another_page[]=$row; } Our array now contains all the rowswe want on the other page. now save it in a session varriable. $_SESSION['Some name'] = $data_for_another_page; or dump it into the databse soemwhere. or just run the same sql and loop on the other page. PS you last 'echo "<th>";' is not needed. |
|
|
|
#9 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 13
|
hello, I'm not trying to display all the records on the next page, I only need the one record displayed on the next page do you know how to display a particular record from the loop? for example: I have, say 5 items in a list displayed on the first page then you choose to click on item 3 from the list, this will now transfer the user to the next page displaying only item 3.... so if the user clicks on item 1 the result on the next page will be item 1 and if the user clicks on item 2 the result on the next page will be item 2 and so on.. any ideas? |
|
|
|
#10 (permalink) | |
|
Senior Member
Join Date: Oct 2006
Posts: 2,175
|
Quote:
Wasn't really a comment on the design, was about your html markup. You would be able to generate less code, and it would be cleaner, if you were to use CSS. http://www.csszengarden.com http://www.cssbasics.com |
|
|
|
|
#11 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,962
|
You need to create a link which contains the item no, description, price so you can carry that info to the payment page fro processing. eg <a href="paymentpage.php?itemno=$itemno&description=$ description&price=$price">$description</a> Then frok there to send them to Paypal, create a Paypal payment button using example values. Examine how the link is made up, elements similar to above. Then replace the values with the values passed in the link above. |
|
![]() |