Hallo.
Nach längerer Programmierpause habe ich wieder mal ein Problem - und zwar:
(zuerst mal der code)
mein Problem: $roomName bzw. $_tables['roomName'] spuckt mir nur einen Datensatz aus - var_dump($result2) jedoch wie folgt:
object(mysqli_stmt)#3 (10) { ["affected_rows"]=> int(-1) ["insert_id"]=> int(0) ["num_rows"]=> int(3) ["param_count"]=> int(1) ["field_count"]=> int(3) ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["sqlstate"]=> string(5) "00000" ["id"]=> int(1) }
auf gut Deutsch: In Wahrheit sind es 3(!) Datensätze und nicht bloß einer.
Was mache ich falsch?
Danke für eure Hilfe im Voraus und
mfG APH
Nach längerer Programmierpause habe ich wieder mal ein Problem - und zwar:
(zuerst mal der code)
PHP-Code:
$sql2 = 'SELECT roomName, tableNoName, seats FROM roomsandtables WHERE roomName = ?';
$result2 = $mysqli->prepare($sql2);
$result2->bind_param('s', $_POST['room']);
$result2->execute();
$result2->bind_result($roomName, $tableNoName, $seats);
while ($result2->fetch()) {
$_tables['roomName'] = $roomName;
$_tables['tableNoName'] = $tableNoName;
$_tables['seats'] = $seats;
}
var_dump($result2);
object(mysqli_stmt)#3 (10) { ["affected_rows"]=> int(-1) ["insert_id"]=> int(0) ["num_rows"]=> int(3) ["param_count"]=> int(1) ["field_count"]=> int(3) ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["sqlstate"]=> string(5) "00000" ["id"]=> int(1) }
auf gut Deutsch: In Wahrheit sind es 3(!) Datensätze und nicht bloß einer.
Was mache ich falsch?
Danke für eure Hilfe im Voraus und
mfG APH
Kommentar