phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Zend Framework Login: Fatal error Cannot use object of type stdClass as array

Tag: framework, zend, zend framework, authentication, Zend_Auth, error, stdClass, array   Category: PHP Framework
post: 22 Apr 2008 read: 2,121


Zend Framework Login System Step by Step Tutorial - Part 4: We run previous post, I get error message like this: Fatal error: Cannot use object of type stdClass as array in C:\AppServ5\www\test\zend\helloworld\ library\Zend\Auth\Adapter\DbTable.php on line 340. If you are same like me, let's fix this problem. Skip this post if you don't fine any error at previous post.

Sadly, I still didn't have much time to know about this error when I was writing this post. So, I decide to fix at core of Zend library. I will tell you latter if I find fixing this error more better than this post.

Ok, open DbTable.php within library\Zend\Auth\Adapter\. Update line 340:

Before:


if ($resultIdentity['zend_auth_credential_match'] != '1') {

Become:


if ($resultIdentity->zend_auth_credential_match != '1') {

Then, update line 346:


unset($resultIdentity['zend_auth_credential_match']);

Become:


unset($resultIdentity->zend_auth_credential_match);

I will update this post if there is more better than this way. Do you want to share idea?



Series this article:
Zend Framework Login: Preparing Database
Zend Framework Login: Creating Form Login
Zend Framework Login: Creating Authentication
Zend Framework Login: Fatal error Cannot use object of type stdClass as array
Zend Framework Login: Protected Page
Zend Framework Login: Creating Logout
Zend Framework Login: Creating Switching for Front Page

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting