Hi everyone, I am trying to run a select query using the results from an earlier successfull query.
See below -
$stmt = $conn->prepare("SELECT * FROM tab1 ORDER BY id DESC");
$stmt->execute();
$total = $stmt->rowCount();
$cstmt = $conn->prepare("SELECT * FROM tab2 WHERE otdc_ref='$stmt->otdq_ordernum'");
$cstmt->execute();
$total = $cstmt->rowCount();
while ($row = $stmt->fetchObject()) {
how is it possible to get the results of the 2nd query to be displayed, At the moment, only the results from the first query are being displayed,
Thanks in advance