concatanating
Posted: Tue Jan 28, 2014 3:34 am
Can someone explain to me how concatenation is used in this function?
1- why does value= $row[id] needs to be concatenated on both sides?
the result of this function returns a list rows with a check-box at the beginning of the line followed by firstname, lastname and email address all equally spaced on the same line. there is a tidbit in there I don't quite get because if I was to write an inline echo line to have the same output, I would write it differently and I am trying to figure out why there is a difference?
or does it have to do with the fact that it is concatenated inside the array todelete[] and then used by the delete query? but that poses a problem since I think we would need to use an explode function... as you can see, I'm not clear on theory and design question.
1- why does value= $row[id] needs to be concatenated on both sides?
the result of this function returns a list rows with a check-box at the beginning of the line followed by firstname, lastname and email address all equally spaced on the same line. there is a tidbit in there I don't quite get because if I was to write an inline echo line to have the same output, I would write it differently and I am trying to figure out why there is a difference?
or does it have to do with the fact that it is concatenated inside the array todelete[] and then used by the delete query? but that poses a problem since I think we would need to use an explode function... as you can see, I'm not clear on theory and design question.
Code: Select all
// Display the customer rows with checkboxes for deleting
$query = "SELECT * FROM email_list";
$result = mysqli_query($dbc, $query);
while ($row = mysqli_fetch_array($result)) {
echo '<input type="checkbox" value="' . $row['id'] . '" name="todelete[]" />';
echo $row['first_name'];
echo ' ' . $row['last_name'];
echo ' ' . $row['email'];
echo '<br />';
}