Hello developers
Last days we had a few issues with the creation of new platform groups.
We have noticed that there was a logfile mdb2.log created (from which we
believe that this is due to the changes of the strict mode etc). In this
logfile we found the following error:
[12:49:41] [Message: MDB2 Error: insufficient data supplied]
[Information: tableInfo: [Error message: Could not generate result resource]
[Last executed query: UPDATE `group_group` SET `left_value`=`left_value`
+ 2 WHERE `left_value` > 1]
[Native code: 0]]
[12:49:41] [Message: MDB2 Error: insufficient data supplied]
[Information: tableInfo: [Error message: Could not generate result resource]
[Last executed query: UPDATE `group_group` SET
`right_value`=`right_value` + 2 WHERE `right_value` > 1]
[Native code: 0]]
After a search together with hans we traced the error back to how mdb2
handles the different queries. It seems that when you use the function
query, the system expects a real resultset from the database.
Unfortunately the query we were trying to execute was an update query
which has true or false as a result. Initially we thought this was due
to a fault in how mdb2 handles results. After some additional searching
hans found out that there is yet another method to be used called exec
which handles results differently.
So in short:
Using queries that return a resultset like /SELECT, SHOW, DESCRIBE/ or
/EXPLAIN /should be executed using query()
Other queries like INSERT, UPDATE, DELETE, ... should be executed using
exec()
Best regards
Sven
--
Met vriendelijke groeten
Sven Vanpoucke
Digitaal Leren
Directie Onderwijs
Hogeschool Gent
http://digitaal-leren.hogent.be/
_______________________________________________
Dev mailing list
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev