Old 17-11-2006, 04:45   #1 (permalink)
JhonnyWalkerBlk
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
  Reply With Quote
Old 17-11-2006, 14:39   #2 (permalink)
gk
geek
 
gk's Avatar
 
Join Date: Oct 2006
Location: *.everywhere
Posts: 204
Send a message via ICQ to gk Send a message via AIM to gk Send a message via MSN to gk Send a message via Yahoo to gk
Maybe a bitmore information. maybe code?

do a "mysql_qury($sql)" outside the loop and inside do "mysql_fetch()".

Need some code to know what your doing.
  Reply With Quote
Old 17-11-2006, 14:52   #3 (permalink)
dtrenz
blam blam
 
dtrenz's Avatar
 
Join Date: Aug 2006
Location: ann arbor, mi usa
Posts: 527
was there a question in there?
  Reply With Quote
Old 17-11-2006, 20:00   #4 (permalink)
JhonnyWalkerBlk
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>";
  Reply With Quote
Old 17-11-2006, 20:07   #5 (permalink)
JhonnyWalkerBlk
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
  Reply With Quote
Old 17-11-2006, 20:54   #6 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,098
font-size -5? jesus christ have I just fell into 1997?
  Reply With Quote
Old 17-11-2006, 22:15   #7 (permalink)
JhonnyWalkerBlk
Registered User
 
Join Date: Nov 2006
Posts: 13
Quote:
Originally Posted by freelancr
font-size -5? jesus christ have I just fell into 1997?

is that all?

I'm not looking for comments on design just programming thanks
  Reply With Quote
Old 18-11-2006, 00:15   #8 (permalink)
gk
geek
 
gk's Avatar
 
Join Date: Oct 2006
Location: *.everywhere
Posts: 204
Send a message via ICQ to gk Send a message via AIM to gk Send a message via MSN to gk Send a message via Yahoo to gk
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.
  Reply With Quote
Old 18-11-2006, 01:57   #9 (permalink)
JhonnyWalkerBlk
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?
  Reply With Quote
Old 18-11-2006, 07:57   #10 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,098
Quote:
Originally Posted by JhonnyWalkerBlk
is that all?

I'm not looking for comments on design just programming thanks

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
  Reply With Quote
Old 18-11-2006, 08:11   #11 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,739
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.
__________________
  Reply With Quote
Old 18-11-2006, 15:47   #12 (permalink)
gk
geek
 
gk's Avatar
 
Join Date: Oct 2006
Location: *.everywhere
Posts: 204
Send a message via ICQ to gk Send a message via AIM to gk Send a message via MSN to gk Send a message via Yahoo to gk
What he said.
  Reply With Quote
Old 18-11-2006, 22:26   #13 (permalink)
JhonnyWalkerBlk
Registered User
 
Join Date: Nov 2006
Posts: 13
Thanks guys, I'll give it a go
  Reply With Quote
Old 19-11-2006, 01:04   #14 (permalink)
JhonnyWalkerBlk
Registered User
 
Join Date: Nov 2006
Posts: 13
Yep that worked, Thanks a lot.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8