Reputation: 1
I have connected a oracle database with PHP. When I try to query a data in sqlplus it works. But when I try to query in PHP, it doesn't work(It doesn't show any error or nothing). My emp_id is number.
<p> $query = "select order_id from ordered_by where order_emp_id =".$emp_id."and order_done='N'";
$stid = oci_parse($conn, $query);
$r = oci_execute($stid, OCI_DEFAULT);
$value="";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS))
{
foreach ($row as $item)
{
$item!== null ? htmlentities($item) :'NULL';
$value =$item;
}
Upvotes: 0
Views: 255
Reputation: 6944
Put a space after =".$emp_id."
$query = "select order_id from ordered_by where order_emp_id =".$emp_id." and order_done='N'";
Upvotes: 2