Samidhya Sarker
Samidhya Sarker

Reputation: 1

Data query working in oracle sqlplus but not in PHP

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

Answers (1)

hkutluay
hkutluay

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

Related Questions