I am trying to create a PHP page that will run a SQL select statement that returns 1 row and take the values in two of the columns to PHP variables but I am getting the error:
PHP Notice: Undefined index: firstname
Here is what the important part of my code looks like:
$sql = " select * from employee e where e.emp_id = 123";
echo $sql;
$stid = oci_parse($Conn, $sql);
oci_execute($stid);
oci_fetch_all($stid, $res, null, null, OCI_FETCHSTATEMENT_BY_ROW);
var_dump($res);
$firstname = $res['firstname'];
Any idea what can be causing this?