我需要$ id变量来填充另一个表并在网站上使用该$ id。有些原因它没有显示变量$ id。
$ mysqli = new mysqli(' host',' user',' password',' db');
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query=$this->database->prepare("SELECT master_id FROM builder_newsletter WHERE type='?' AND version='?' AND date='?'");
$query->bind_param("xyz", $type, $version, $date);
$query->execute();
$query->bind_result($id);
$query->fetch();
printf($id);
$query->close();