December 3rd, 2012, 12:27 PM
Multiple column data in echo statement
Since my last few posts I have gained a better understanding of PHP and feel more comfortable with the code.
How do I pull data from multiple columns into one <td> echo statement?
<td>Name:</td><?php echo $customer['first_name' AND 'last_name']; ?>
That is what I've tried, it returns only the firstName. I have tried to concatenate it but I'm stumped. Any help is appreciated.
Also, I don't know if it matters but I have a
foreach (customers as customer) : ?>
December 3rd, 2012, 12:37 PM
<td>Name:</td><?php echo $customer['first_name'] . ' ' . $customer['last_name']; ?>
The former is more correct
<td>Name:</td><?php echo $customer['first_name']; ?> <?php echo $customer['last_name']; ?>
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.