Turning on BASE64 plugin throws fatal error

27 views
Skip to first unread message

Nick

unread,
Aug 12, 2011, 9:14:52 PM8/12/11
to Php Object Generator
Here are the steps I took:

1. enabled the base64 plugin in the admin panel
2. set the configuration file to turn base64 on
3. ran "re-create tables" and perform unit tests, POG me up!
4. Everything looks fine in the admin panel, but any operations throw
the fatal error

<b>Fatal error</b>: Call to a member function fetch() on a non-object
in <b>/project/objects/class.database.php</b> on line <b>57</b><br />

One of my objects:
http://www.phpobjectgenerator.com/?language=php5.1&wrapper=pdo&pdoDriver=mysql&objectName=Vote&attributeList=array+%28%0A++0+%3D%3E+%27Event%27%2C%0A++1+%3D%3E+%27locationId%27%2C%0A++2+%3D%3E+%27email%27%2C%0A++3+%3D%3E+%27timestamp%27%2C%0A++4+%3D%3E+%27hasBeenRemoved%27%2C%0A%29&typeList=array%2B%2528%250A%2B%2B0%2B%253D%253E%2B%2527BELONGSTO%2527%252C%250A%2B%2B1%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B2%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B3%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2B%2B4%2B%253D%253E%2B%2527TINYINT%2527%252C%250A%2529

Crispy

unread,
Aug 16, 2011, 11:37:54 PM8/16/11
to Php Object Generator
Hi Nick,

usually this means that the database connection has not been created.
i.e. wrong username/password

make sure that you have the configuration.php created with the
database settings, and that it is included on the page that is using
the pog object.

I'm surprised that the admin panel worked, if the configuration.php is
not there, so maybe it is just that it isn't included on the page in
question.

-Mark

On Aug 12, 6:14 pm, Nick <n...@unitedweego.com> wrote:
> Here are the steps I took:
>
> 1. enabled the base64 plugin in the admin panel
> 2. set the configuration file to turn base64 on
> 3. ran "re-create tables" and perform unit tests, POG me up!
> 4. Everything looks fine in the admin panel, but any operations throw
> the fatal error
>
> <b>Fatal error</b>:  Call to a member function fetch() on a non-object
> in <b>/project/objects/class.database.php</b> on line <b>57</b><br />
>
> One of my objects:http://www.phpobjectgenerator.com/?language=php5.1&wrapper=pdo&pdoDri...

Nicholas Velloff

unread,
Aug 17, 2011, 1:18:25 PM8/17/11
to php-object...@googlegroups.com
Hi Mark,

That is not the case. If I turn off the encoding it all works fine.

I have been using this library for a while now and it works great, but I'm concerned about security if I cant get this working.

Any help is appreciated.

Nick

> --
> You received this message because you are subscribed to the Google Groups "Php Object Generator" group.
> To post to this group, send email to php-object...@googlegroups.com.
> To unsubscribe from this group, send email to php-object-gener...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/php-object-generator?hl=en.
>

Crispy

unread,
Aug 19, 2011, 12:58:19 AM8/19/11
to Php Object Generator
Hi,

I just tried this out on my system - generated the object Event and
Vote
turned on encoding - etc etc...

so these are my thoughts.
When you installed the base64 plugin, did it succeed?
I've had issues with some databases from time to time, and installing
the plugin doesn't always work from setup... if, for example, the user
you are connected to the database with doesn't have permissions to
install procedures "Create_routine_priv" , or is not allowed to
execute them "Execute_priv", then it likely will not succeed.

if you have both then great... even then I've had occasional troubles
-- the db needs these privileges as well as the user perhaps? I'm not
sure at the moment.

If you don't have privileges, and you have root access to the db, you
can install the plugin by hand. You will need execute_priv for your db
and db user of course.

add to the top of the file plugins/base64_install.sql this:
delimiter |
then inject the procedures and table into your database;
mysql -u root -p yourdatabasename < plugins/base64_install.sql

Once it is there it should be ok.

this is my test index.php

<pre>
<?php
require_once 'configuration.php';
require_once 'objects/class.database.php';
require_once 'objects/class.vote.php';
require_once 'objects/class.event.php';

echo "hello\n";

$vote = new Vote();
$list = $vote->GetList();

echo count($list)."\n";
var_export($list);

echo 'done';
?>
</pre>

I used the setup area to put a couple values in Vote
for this test I installed this stuff in my `test` database, so I can
see the data in the db with
mysql -u root -p test
select * from vote;
the text data is encoded as expected -- setup seems fine. tests all
pass.

I hope this gives some clue to what is different between us.

-Mark
Reply all
Reply to author
Forward
0 new messages