I'm running this within an html file (with a .php extension), yet when I inspect element, the iframe doesn't appear. Error reporting shows a problem with va5 and bind_param. When I call this php, I don't always have a variable5. How could I fix this?
<?php
$va1 = $_GET['variable1'];
$va2 = $_GET['variable2'];
$va3 = $_GET['variable3'];
$redetails = NULL;
$redetails2 = NULL;
$redetails = $_GET['rdetails'];
$redetails2 = $_GET['redetails2'];
$stmt = $mysqli->prepare("SELECT id FROM idlist WHERE var1 = ? && var2 = ? && var3 = ? && var4 = ? && var5 = ?");
//failing
$stmt->bind_param('sssss', $va1, $va2, $va3, $va4, $va5);
$stmt->execute();
$result = $stmt->get_result();
//failing
echo $result[0];
//failing
echo '<iframe src="https://drive.google.com/file/d/' . $result[0] . '/preview" width="850" height="1150"></iframe>';
?>