Two queries on same table
I have a table (Table1) with the following fields:
Name
Quantity
Date
Description
There are multiple records with the same name. For instance 3 Johns and 4 Smiths.
I want to display this data as follows in a table.
First line:
Name
Subsequent lines:
Date, Quantity, Description for each record with that name
With one line per each.
Then Name again
And then one line per each record with that name
Etc.
It would look like this:
John
10/5/21 5 Red buttons
11/6/21 3 Black Ties
Smith
09/5/21 8 Yellow curtains
12/6/21 2 Blue Pansies
My sql query is
<?php
$rsTable1 = new WA_MySQLi_RS("rsTable1 ",$siteguide2018,0);
$rsTable1 ->setQuery("SELECT * FROM Table1 ORDER BY Name");
$rsTable1 ->execute();
?>
Can I put another query using the same table in a sub-table like this?
<?php
$rslist = new WA_MySQLi_RS("rslist ",$siteguide2018,0);
$rslist ->setQuery("SELECT * FROM Table1 WHERE Name = ? ORDER BY Date");
$rslist ->bindParam("i", "".($rsTable1->getColumnVal("Name")) ."", "0");
$rslist ->execute();
?>
Or will having two open queries on the same table cause trouble?