//--just using $allEntities for outputting some stuff to the browser.
1) $allEntities = $orm->select('Entity');
//--now load any entity with any valid id
2 $id = 18;
3) $entity = $orm->load('Entity', $id);
//--change any property
3) $entity->property = 'some new value';
//--suppose to save entity but this is not the case
4) $orm->save($entity);
I am getting the following error:
Syntax error or access violation: 1064 You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'WHERE id = '18''
I checked the real SQL UPDATE statement and it is:
UPDATE entities SET WHERE id = '18'
Note how there are no field=value list after the SET keyword.
Once I remove the line #1 (loading all entities), the code works
perfectly well. Looks like loading all entitiess mess up internal data
structures, etc. Please note that even if you replace lines #2, #3
with foreach iteration (the right way to access loaded entities) the
same thing happens. So, this is a major thing I beleive because it
stops developers from using a very good use case: loading entities,
iterating over them, doing some changes, and saving some entities
back.
Hope you or someone else can fix that shortly - completely flat out
these days, won't be able to contribute, sorry.
--
You received this message because you are subscribed to the Google Groups "Outlet ORM" group.
To post to this group, send email to outle...@googlegroups.com.
To unsubscribe from this group, send email to outlet-orm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/outlet-orm?hl=en.
I ran the test again and it works like a charm. Thanks a lot for your
fantastic effort!
Cheers!
On Dec 22, 10:58 am, "Fabio R." <fgr...@gmail.com> wrote:
> Hi T T,
>
> Thanks for reporting the bug.
>
> We've fixed the code and it is on trunk:
> svn://knowledgehead.com/outlet/outlet-orm/trunk
>
> Would you be able to test it and see if things are running fine? Would be
> nice to have a feedback before releasing 1.0rc2.
>
> Cheers,
> --
> Fábio Rehm
>
> > outlet-orm+...@googlegroups.com<outlet-orm%2Bunsu...@googlegroups.com>