You don't have to explicitly declare your properties in your model. Remove your two property definitions and see if it works.
We don't currently support PHP6.
Hey guys,
thanks for your replies!
@Taylor: When I remove the properties from the model, I get the following error:
Uncaught exception 'ActiveRecord\UndefinedPropertyException' with message '
Undefined property: User->name in [...]/activerecord/lib/Model.php on line 428
Undefined property: User->emailaddress in [...]/activerecord/lib/Model.php on line 428
' in [...]/activerecord/lib/Model.php:1066
Stack trace:
#0 [...]/activerecord/lib/Model.php(357): ActiveRecord\Model->set_attributes_via_mass_assignment(Array, true)
#1 [...]/activerecord/lib/Model.php(738): ActiveRecord\Model->__construct(Array)
#2 [...]/index.php6(23): ActiveRecord\Model::create(Array)
#3 {main}
thrown in [...]/activerecord/lib/Model.php on line 1066
@Kien: That's really a pity, my hoster only offers me PHP 5.2 and 6 :(
Bernhard
(1-3/3)
Subject: Troubles getting started
Hey there,
trying to get php.activerecord running with a simple example, but it doesn't work.
My (hosters') config:
- PHP 6 (more infos: http://www.ihre-webhosting-domain.de/php/phpinfo.php6)
- mySQL: "SELECT VERSION" returns "5.0.91-log"
My table:
My "User" class:
My index.php6 file:
The user, pass, host and dbname placeholders I have replaced with the ones of my local installation.
When I run this, I get the following error:
(I've replaced the long path of my hosters system by placeholder PATH in the stacktrace).
Does anyone know why I'm getting this error? Why is there an empty string in the field list?
Is there a way to get the complete sql code that was used for the insert, instead of the truncated one?
Many thanks in advance,
Bernhard