Is it possible to do multiple query's in the same .php and bind them to show in different places?
For example I'm using:
<?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()){
?>
And then displaying the result with
<?=$rowPic?>
But I wanna be able to use another "$_POST['art_number2']" to get bound to
<?=$rowPic2?>
Is this possible? and how? Thankful for answers!
Changed this to:
<?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);
$stmt->bind_param('s', $_POST['art_number2']);
$stmt->execute();
$stmt->bind_result($rowPrice2, $rowHeader2, $rowPic2, $rowArt12, $rowArt22, $rowArt32, $rowArt42);
while($stmt->fetch()){
?>
Now only the second selection shows as result.