Thank you all for you help! I received some phenomenal help about 17 days ago which saved my *!. I am still learning PHP and have run across a new problem. I have a MYSQL database field called "Tracking" this is a long text field in which we want to input tracking numbers (for shipping) separated by commas . We ship some times 20-50 individual boxes in the same order.
The following script outputs to an HTML table the number of boxes being shipped (EX Box 1 of 12, Box 2 of 12...etc) and then the value of the tracking number field. I need to modify it so it parses at the "comma" in the Tracking field and includes the tracking number for each box. So Box 1: Tracking Number "take first tracking number and end at comma", So Box 2: Tracking Number "take second tracking number and end at comma"....etc...does this make sense?
Please provide whatever help possible, would greatly be appreciated!
Script:
<?php
$q = intval($_GET['q']);
$con = mysqli_connect('***','***','***','***');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,"db116223_wmi");
$sql="SELECT * FROM tbl_purchase_order WHERE purchase_order_id = '".$q."'";
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($result)) {
for ($i=0; $i<$row['product_quantity']; $i++) {
$my_val=1;
$x += 1;
echo "<table>";
echo "<tr>";
echo "<td width=400><br>Box $x of ". $row['product_quantity'] ." Tracking Number:". $row['Tracking'] ."</td>";
echo "</tr>";
echo "</table>";
}
}
mysqli_close($con);
?>
JB