<?php
$fivesdrafts = $wpdb->get_results(" SELECT......");
foreach ( $fivesdrafts as $fivesdraft ) {
$user_gift = $fivesdraft->recommend_getdetailgift;
echo $user_gift;
}
?>
Output:
Television
Computer
Mobile
I want to display these values into the below form
<input type="hidden" value="???" name="getallgifts" >
So that I can get that store into $_POST['getallgifts']. In this way, I can send that in email.
Check here the actual code which I'm using in order to achieve my result
UPDATED
$getallgifts = $_POST['getallgifts[]'];
$message = 'Request From : '.$getallgifts.'
------
<form method="post" action="#" class="getfffff" style="text-align:center;">
<?php
$fivesdrafts = $wpdb->get_results(
"
SELECT *
-----
);
foreach ( $fivesdrafts as $fivesdraft )
{
$user_gift = $fivesdraft->recommend_getdetailgift;
echo '<input type="hidden" value="' . $user_gift . '" name="getallgifts[]" >';
}
?>
<input type="hidden" value="<?php echo $user_sum; ?>" name="getwwitdreawv">
</form>