Thanks CraigR,
I can loop a recordset AND use an inner var using this method:
<?php
$sql="SELECT tblinvtype.typeId, tblinvtype.typeName FROM tblinvtype WHERE tblinvtype.`typeSibling` = ?";
echo $subtarget = ($rsParent->getColumnVal("typeId"));
/* Prepare statement */
$stmt = $rtk_i->prepare($sql);
if($stmt === false) {
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $rtk_i->error, E_USER_ERROR);
}
/* Bind parameters. TYpes: s = string, i = integer, d = double, b = blob */
$stmt->bind_param('i',$subtarget);
/* Execute statement */
$stmt->execute();
?>
<?php
$stmt->bind_result($typeId, $typeName);
while ($stmt->etch()) {
echo $typeId. ', ' . $typeName . '<br>';
}
?>
Referenced in this article:
http://www.pontikis.net/blog/how-to-use-php-improved-mysqli-extension-and-why-you-should