I am trying to select a user id (uID) just to check if it exists… I am getting stuck at just the most basic select statement…
I’ve searched and tried different people’s code but either my code always returns true (if i dont use fetch) or it says that it is not an object and i cant not use fetch….
$sql = 'SELECT uID FROM ldc_user_details where uID=3';
$q = $this->db->prepare($sql);
$i=$q->execute();
foreach ($i->fetch() as $key => $val){
echo 'key='.$key." val =".$val;
}
ERROR: Call to a member function fetch() on a non-object in /home/pdwdev/public_html/ldc_main.php
?>