prepare("SELECT id, building_name FROM buildings WHERE org_id = ? ORDER BY Name ORDER BY building_name")) { #bind the criteria variable $stmt->bind_param('i', $oid); #assign a value to the bound variable $oid = 1854; #execute the prepared select $stmt->execute(); #if query was successful. . . if($stmt->affected_rows >=1){ #bind variables to prepared statement $stmt->bind_result($bldgId, $bldgName); #fetch values while ($stmt->fetch()) { #ASSIGN TO