Monday, 19 August 2013

PHP Mysql with fetch array

PHP Mysql with fetch array

$bagianWhere = "";
if (isset($_POST['chkBadge']))
{
$badge_id = $_POST['badge_id'];
if (empty($bagianWhere))
{
$bagianWhere .= "t_emp.badge_id = t_balance.badge_id and
E.badge_id = '$badge_id'";
}
}
$query = "SELECT t_emp.badge_id, t_emp.emp_name,
t_balance.badge_id,
t_balance.balance_amount
from t_emp, t_balance WHERE
".$bagianWhere ;
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil))
I don't know what happened with my PHP code. I tried hard, but still
facing problem with error like this :
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean
given in ...
Anyone advice please.

No comments:

Post a Comment