I am having issue trying to display a database result on page load and form submit. when the page loads it keeps giving me blank page but when I submit the form, I get results.
<?php
$alpha = mysql_real_escape_string($_POST['alpha']);
$p ="^[".$alpha."]";
if (!isset($p)&&empty($p)){$p = "^[a-z]";}
$select = "SELECT u.pname,u.categoryid,p.amountpaid,p.teller,p.handler,
p.scollection,p.project,p.levies,p.status,q.quarter,q.year,
p.invoice,q.ordinary_cf,q.special_cf,q.cate_id
FROM users u
INNER JOIN tbl_paymentalert p
ON u.categoryid = p.catid
INNER JOIN tbl_quartersummary q
ON p.catid= q.cate_id
WHERE q.quarter = :quarter AND q.year = :year AND pname REGEXP :p
ORDER BY u.pname limit :eu,:limit
";
$q=$conn->prepare($select);
$q->bindValue(':quarter', $quarter, PDO::PARAM_STR);
$q->bindValue(':year', $year, PDO::PARAM_STR);
$q->bindValue(':p', $p, PDO::PARAM_STR);
$q->bindValue(':eu', $eu, PDO::PARAM_INT);
$q->bindValue(':limit', $limit, PDO::PARAM_INT);
$q->execute();
?>