Hello,
I am trying to build a report page from my db, where several queries will be echo for research purpose. The report will include at least 15 to 20 queries, see example of 2 below. Do you think there is an easiest way to do this instead of listing 20 queries?
<?
$result1 = @("select id from table where start_date between '2000-01-01'
and '2004-12-31' and fend_date between '2004-01-01' and '2005-12-31'
OR start_date between '2000-01-01' and '2004-12-31' and end_date like '0000-00-00'");
while ($row= mysql_fetch_array($result1))
{
$id = $row['id'];
$start_date = $row['start_date'];
$end_date = $row['end_date'];
$tipoprograma = $row['tipoprograma'];
$count ++;
}
$result2 = @("select id from table where start_date between '2000-01-01'
and '2004-12-31' and end_date between '2004-01-01' and '2005-12-31' and tipoprograma like '%Adulto%'
OR start_date between '2000-01-01' and '2004-12-31' and end_date like '0000-00-00' and tipoprograma like '%Adulto%'");
while ($row= mysql_fetch_array($result2))
{
$id = $row['id'];
$start_date = $row['start_date'];
$end_date = $row['end_date'];
$tipoprograma = $row['tipoprograma'];
$counta ++;
}