Bind_result & bind_param som array - MySQLI Prepared Statement.
Jeg er igang med at lave OOP(php).Jeg vil lave metoder som kan indsætte, slette, update, og fetche.
Jeg vil angive bind_param og bind_result som array...
f.eks:
<?php
$tableColumns = "id, parent_id, title";
$tableTitle = 'menu';
$params = 'id, title';
$tableColumnArray = explode(', ', $tableColumns);
$paramArray = explode(', ', $params);
if($stmt = $obj->prepare
('SELECT '. $tableColumns .
' FROM '. $tableTitle .
' WHERE ' . implode($paramArray, '=? AND ') . '=?')){
$stmt->bind_param('$'.(implode(', $', $paramArray)));
$stmt->execute();
$stmt->bind_result('$'.(implode(', $', $tableColumnArray)));
}
?>
Jeg håber at i forstår hvad jeg vil ?