rgb192
asked on
foreach (echo one line)
now I want to call email
foreach email
echo email
only want one echo line
foreach email
echo email
only want one echo line
$dbdetails = dbfetchsingle("SELECT BillFirstName, BillLastName, company, email, email2 FROM orders WHERE orderid = '$this->orderid'");
$this->dbdetails = $dbdetails;
$this->emails = array($dbdetails['email']);
if(strlen($dbdetails['email2']) > 0) {
$this->emails[] = $dbdetails['email2'];
}
Isn't the orderId a unique identifier in the table? If so, the query should only return 1 row. This would eliminate the need for a 'for each' statement. Use the echo email to see the email value returned from the query.
yeah use GROUP BY email, email2
ASKER
so what is the echo command or the changed code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks