我有以下代码,它运行良好。我只是从数据库输出数据有问题,因为输出错误。
输出为:
email : admin@admin.com
email : 120
或
email : admin@admin.com
email : click
email : 28
现在我的问题是,如何将输出中的“电子邮件”一词更改为其他词。
这是我的数据库:
ID | entry_id | field_id |子弹|值
<?php
get_header();
include 'connection.php';
$theentry_id = 0;
if ( isset( $_GET['entry_id'] ) ) {
$theentry_id = $_GET['entry_id'];
}
echo '<div style="max-width:500px; padding-right:30px; padding-left:30px; margin:auto;">';
if ( $theentry_id > 0) {
//connect to db
$stmt = $mysqli->prepare( "select slug ,value from wp_cf_form_entry_values WHERE entry_id = ? order
BY slug ");
$stmt->bind_param("d", $theentry_id );
$stmt->execute();
$result = $stmt->get_result();
if($result->num_rows > 0){
while ($row = $result->fetch_assoc()) {
echo "email : " ,$row['value'] , "<br>";
}
}
} else {
echo "Error,no data";
}
echo "</div>";
get_footer();
?>
答案 0 :(得分:1)
因此,如果我理解正确,那么您将尝试不仅输出.as-console-wrapper { top: 0; max-height: 100% !important; }
,还输出其含义?
因此,在email
而不是while
的{{1}}循环中,仅使用块或调用它。像这样:
echo "email : ..."