此代码将打印如下结果:
test1@bnas.com.mytest2@bnas.com.my
那么我如何将结果分成2个变量,例如email [0],email [1] ???
$TEST='i192a';
$stid = oci_parse($conn, 'select email from BNS_NOTIFY_RECIPIENT where screen =:num0');
oci_bind_by_name($stid, ':num0',$TEST);
oci_execute($stid);
$count = 0;
while (($row = oci_fetch_row($stid)) != false) {
$EMAIL=$row[0];
echo $EMAIL;
}
答案 0 :(得分:0)
只需将$email
做成一个数组,并在每次循环中将值压入其中。然后,您可以使用implode
输出(例如)逗号分隔的列表:
$email = array();
while (($row = oci_fetch_row($stid)) != false) {
$email[] = $row[0];
// you could process each email here if you wanted to
}
// output comma separated list of emails
echo implode(',', $email);