How can I get a the variable to use in other tables

2013-07-24 php mysqli

I need $id variable to use to populate another table and to use that $id on website. Some reason it is not showing the variable $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();

Answers

Related