Im trying to structure more than one sql query over another so that I could produce the result in a pdf (using tcpdf). I cant use joins in this case because i have 3 columns(in the table i want to produce) that have different where conditions for each. Ive tried putting one query over the other but get the following error.
Fatal error: Uncaught Error: Call to undefined method mysqli::query1() in C
This is my erroneous code. Could someone please show me where ive gone wrong with structuring this?
function fetch_data()
{
$output = '';
include ('dbcon.php');
$query1 = $conn-> query1("SELECT empfname, emplname from employee");
while ($row1 = $query1 -> fetch_array()){
$query = $conn -> query("SELECT count(1) from tasks WHERE pf = '1' and stats ='0' ");
while($row = $query -> fetch_array())
{
$number = $row[0];
$output .= '<tr>
<td>'.$number.'</td>
<td>'.$row1["empfname"].'</td>
<td>'.$row1["emplname"].'</td>
</tr>
';
}
}
return $output;
}