I have a little situation. I'm building a Point of Sales application for my company. Everything works great so far. I have a variable that is passed from one page to anouther. When you start the invoice process you select a customer and the items being purchased. You select a customer threw a drop down box. Customer first name, last name and account number are thrown into a variable call customer. This information is passed to the next page that displays the order including the customer variable. what i want to do is extract the accountnumber so i can pull the clients personal information out of the customer database so it will be displayed on the invoice.
this is the code for the drop down on the first page:
<?
//Shows all the customers in a popup box.
$result = mysql_query("SELECT * FROM customers ORDER BY LastN",$db);
while ($myrow = mysql_fetch_assoc($result))
{
echo "<option value=\"$myrow[FirstN] $myrow[LastN] [$myrow[AccountNum]]\">$myrow[LastN], $myrow[FirstN] ($myrow[AccountNum])";
}
?>
this is the code on the invoice page:
echo "<tr><td>Ordered by: $Customer</td></tr>
just to recap, i need to split $Customer back into its original parts $FirstN, $LastN and $AccountNum
am i going to wrong way about this? or am i on a pretty good track. Any help will be appreciated. Thanks
Myk