jak82 Posted October 18, 2007 Share Posted October 18, 2007 Hey there, I am using the PDO fetch command to return a vlue from the database, now the problem I am having is being able to access the value, $bob = $result->fetch(PDO::FETCH_ASSOC); print_r($bob); When I print it out on screen I get Array ( [assessmentID] => 1 ) If I try $bob[0] it return nothing, any ideas? Chris Link to comment https://forums.phpfreaks.com/topic/73766-how-to-access-values-from-the-pdo-fetch-command/ Share on other sites More sharing options...
PHP_PhREEEk Posted October 18, 2007 Share Posted October 18, 2007 The print_r is telling you that the array element is $bob[assessmentID], and that its value is 1 $bob[0] does not exist PhREEEk Link to comment https://forums.phpfreaks.com/topic/73766-how-to-access-values-from-the-pdo-fetch-command/#findComment-372189 Share on other sites More sharing options...
jak82 Posted October 18, 2007 Author Share Posted October 18, 2007 thanks phreeek, That works fine now , Chers Link to comment https://forums.phpfreaks.com/topic/73766-how-to-access-values-from-the-pdo-fetch-command/#findComment-372191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.