Getting error "Call to a member function execute() on a non-object"
Can seem to get this to work without getting an error "Call to a member function execute() on a non-object" Here is my code below, what am I not doing or doing wrong that this error is being generated? Thanks in advance!

    <?php
    ....my db connection...

	if ($stmt = $mysqli->prepare("SELECT ID,firstname,lastname,spousefirst,phonecell,email,date,contacttype,status FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') ORDER BY date DESC")) {
		$stmt->execute();
		$stmt->bind_result($ID,$firstname,$lastname,$spousefirst,$phonecell,$email,$date,$contacttype,$status);
	}

    if (($_GET['date'] == 'today')) {
	    $stmt = $mysqli->prepare("SELECT ID,firstname,lastname,spousefirst,phonecell,email,date,contacttype,status FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND date = DATE(NOW()) ORDER BY date DESC"); 
		$stmt->execute();
		$stmt->bind_result($ID,$firstname,$lastname,$spousefirst,$phonecell,$email,$date,$contacttype,$status);
	}


	while ($stmt->fetch()) {
		    echo'
		<table>
			<tbody>       
				<tr>
 					<td width="10"><input type="checkbox" name="" id="" value="'.$ID.'"></td>
					<td><a href="/cms/leads/view/?ID='.$ID.'"><strong>'.$firstname.' '.$lastname.'</strong></a></td>
					<td><a href="/cms/leads/view/?ID='. $ID.'">'.$spousefirst.'</a></td>
					<td>'.$phonecell.'</td>
					<td><a href="mailto:'. $email.'">'.$email.'</a></td>
					<td>'.date("M jS, g:i A", strtotime($date)).'</td>
					<td>'.$contacttype.'</td>
					<td>'.$agentassigned.'</td>
					<td>'.$status.'</td>
					<td><a href="/cms/contacts/notes.php?ID='.$ID.'">View </a>+</td>
					<td><a href="/cms/contacts/todo.php?ID='.$ID.'">View </a>+</td>
					<td><a href="/cms/contacts/deletesuccess.php?ID='.$ID.'">D</a></td>
				</tr>
			</tbody>
		</table>';
	}
	$stmt->close();

    $mysqli->close();

    ?>

Getting error "Call to a member function execute() on a non-object"
===

Can seem to get this to work without getting an error "Call to a member function execute() on a non-object" Here is my code below, what am I not doing or doing wrong that this error is being generated? Thanks in advance!

    <?php
    ....my db connection...

	if ($stmt = $mysqli->prepare("SELECT ID,firstname,lastname,spousefirst,phonecell,email,date,contacttype,status FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') ORDER BY date DESC")) {
		$stmt->execute();
		$stmt->bind_result($ID,$firstname,$lastname,$spousefirst,$phonecell,$email,$date,$contacttype,$status);
	}

    if (($_GET['date'] == 'today')) {
	    $stmt = $mysqli->prepare("SELECT ID,firstname,lastname,spousefirst,phonecell,email,date,contacttype,status FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND date = DATE(NOW()) ORDER BY date DESC"); 
		$stmt->execute();
		$stmt->bind_result($ID,$firstname,$lastname,$spousefirst,$phonecell,$email,$date,$contacttype,$status);
	}


	while ($stmt->fetch()) {
		    echo'
		<table>
			<tbody>       
				<tr>
 					<td width="10"><input type="checkbox" name="" id="" value="'.$ID.'"></td>
					<td><a href="/cms/leads/view/?ID='.$ID.'"><strong>'.$firstname.' '.$lastname.'</strong></a></td>
					<td><a href="/cms/leads/view/?ID='. $ID.'">'.$spousefirst.'</a></td>
					<td>'.$phonecell.'</td>
					<td><a href="mailto:'. $email.'">'.$email.'</a></td>
					<td>'.date("M jS, g:i A", strtotime($date)).'</td>
					<td>'.$contacttype.'</td>
					<td>'.$agentassigned.'</td>
					<td>'.$status.'</td>
					<td><a href="/cms/contacts/notes.php?ID='.$ID.'">View </a>+</td>
					<td><a href="/cms/contacts/todo.php?ID='.$ID.'">View </a>+</td>
					<td><a href="/cms/contacts/deletesuccess.php?ID='.$ID.'">D</a></td>
				</tr>
			</tbody>
		</table>';
	}
	$stmt->close();

    $mysqli->close();

    ?>
