I'm very new to PDO/PHP and I'm converting a very old VBScript order system to PDO/MYSQL. All is going well until now.
I have a simple order form for products and quantities, no calculations or payments. It works fine except that all of the products that are not selected are shown as blank lines on the next HTML page, which is to preview the order.
I've tried a number of ways to fix the problem, but no success yet. This is the code:
$quantity1 = $_POST['quantity1'];
foreach($_POST['plantname1'] as $key => $plantname1)
{
$quantity1 = isset($_POST['quantity1'][$key])? $_POST['quantity1'] [$key]:'Not selected';
if($quantity1 != 0);
else ($plantname1 = ''. $quantity1 = '') ;
$message[] = $quantity1.' '. $plantname1 ;}
echo implode('<br>', $message);
unset($message);
Any help would be much appreciated.