Можно ли сделать несколько запросов в одном и том же .php и связать их для показа в разных местах?
Например я использую:
<?php
include 'dbc.php';
$query = "SELECT art_price, art_header, art_pic, art_row1, art_row2, art_row3, art_row4 FROM signs WHERE art_number = ?";
if($stmt = $conn->prepare($query)){
$stmt->bind_param('s', $_POST['art_number']);
$stmt->execute();
$stmt->bind_result($rowPrice, $rowHeader, $rowPic, $rowArt1, $rowArt2, $rowArt3, $rowArt4);while($stmt->fetch()){
?>
<?php
include 'dbc.php';
$query = "SELECT art_price, art_header, art_pic, art_row1, art_row2, art_row3, art_row4 FROM signs WHERE art_number = ?";
if($stmt = $conn->prepare($query)){
$stmt->bind_param('s', $_POST['art_number']);
$stmt->execute();
$stmt->bind_result($rowPrice, $rowHeader, $rowPic, $rowArt1, $rowArt2, $rowArt3, $rowArt4);
while($stmt->fetch()){
?> ... <?php
}
$stmt->bind_param('s', $_POST['art_number2']);
$stmt->execute();
$stmt->bind_result($rowPrice2, $rowHeader2, $rowPic2, $rowArt12, $rowArt22, $rowArt32, $rowArt42);while($stmt->fetch()){
?>
Других решений пока нет …