0

I'm getting this error and after checking for similar errors I verified the syntax is correct. The complete error is;

WRITE OK
READ OK

Notice: Undefined variable: dbRead in C:\vhosts\phpcs5\lesson07\workfiles\scripts\user_registration.php on line 28

Fatal error: Call to a member function quoteInto() on a non-object in C:\vhosts\phpcs5\lesson07\workfiles\scripts\user_registration.php on line 28

My connection is defined as:

$dbwrite = new Zend_Db_Adapter_Pdo_Mysql($write);
$dbread =  new Zend_Db_Adapter_Pdo_Mysql($read);

I did a test first to make sure it can see the database which is what the Write OK and Read OK are as follows;

if ($dbwrite->getConnection()) {
      echo 'WRITE OK<br/>';
  }
  if ($dbread->getConnection()) {
      echo 'READ OK';
  }

So I'm not sure why I'm getting this error.

Fabio
  • 23,183
  • 12
  • 55
  • 64
  • You need to provide us the lines from user_registration.php, at minimum 5 after and before line 28. – sunshinejr Mar 06 '14 at 00:21
  • possible duplicate of [PHP: "Notice: Undefined variable" and "Notice: Undefined index"](http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index) – Phil Mar 06 '14 at 02:21

1 Answers1

1

dbRead is undefined. You've defined $dbread. Note the capitalization.

Look through your code base (particularly user_registration.php line 28) and switch all instances to one or the other.

mpen
  • 272,448
  • 266
  • 850
  • 1,236