I'm trying to select a specific ID that is auto-generated by the oracle database for a specific session user(from log in and its working fine). I'm using MDB2 to achieve this. I am following the pear: MDB2 manual and did the codes the way it is but I'm getting an error. Please help.
I have used the fetchOne(MDB2_FETCHMODE_ASSOC) to achieve this from the reading manual and its giving an error
<?php
session_start();
$user = $_SESSION['user'];
echo "Welcome:\t".$user;
require_once 'MDB2.php';//pear MDB2
include "conn.php";
$do= "SELECT customer_id FROM customer WHERE username=".$user;
$query= $db->query($do);
if($one=$query->fetchOne(MDB2_FETCHMODE_ASSOC)){
$id= $one['customer_id'];
echo ($id);
}
?>
The number 2 should be printed out but instead there this error: Fatal error: Call to undefined method MDB2_Error::fetchOne() in C:\wamp64\www\grahams\home.php on line 12