Welcome Guest, Not a member yet? Register   Sign In
CI 1.7 - Error on querys (quotes escaping problems)
#21

[eluser]Michael Layne[/eluser]
I also hit this wall after upgrading from 1.6.3 to 1.70. FALSE took care of it, but this may be related...

When I initially wrote this query, I kept on getting errors until I tried several ways of escaping the formatting for DATE_FORMAT. The only thing that worked was the following:

Code:
// had to escape the "first" format, but not the second...
$select = "c.*, DATE_FORMAT(c.birth_day, \"%M %d, %Y\") as bday, DATE_FORMAT(c.date_modified, '%M %d, %Y') as last_modified, c.parent_id, camps.camp_name, camps.camp_desc";

Only way it worked. At least with 1.7.0, I could remove the backsticks (was that proper use of the term?)

Wonder if it was related... Thanks for the FALSE help though!

Michael
#22

[eluser]mycroes[/eluser]
Already posted some about it in another topic about the same issue, but now I noted the next issue:
$this->db->orderby('column, othercolumn'); gets unusable too...
Regards,

Michael
#23

[eluser]mycroes[/eluser]
workaround for issue above: $this->db->orderby('`column`,`othercolumn`');
#24

[eluser]mycroes[/eluser]
Next issue concerning quatation, join is also producing incorrect queries... Seems that instead of using 2 parameters you can concatenate them and put on in between, seems to make it somewhat better... I've stopped trying to 'fix' stuff though, I think I could keep on going for days otherwise...
#25

[eluser]moodh[/eluser]
Just thought I'd mention some more backtick problems:
Code:
// Needs FALSE as second parameter
$this->db->select("blog_entries.*, blog_entries.name AS author");

// Otherwise it produces the following, note the * which can't be backticked.
SELECT `blog_entries`.`*`, `blog_entries`.`name` AS `author`
#26

[eluser]jleequeen[/eluser]
Does anyone know the status on these fixes? I really do not look forward to going back into my models and putting FALSE everywhere I want to use an asterisk. I just finished a project last week using 1.6.3 and it was working perfectly fine, and just upgraded to 1.7 and am having these problems with queries, so I have to downgrade back to 1.6.3 until the fixes are complete.
#27

[eluser]Pascal Kriete[/eluser]
A bunch of this has been fixed in the trunk. So you could upgrade to unstable if you want to make use of the new form validation library.

[Edit: Ok, I lied - still broken if you specified a table prefix]
#28

[eluser]auston[/eluser]
I believe the bug is in /system/database/DB_active_rec.php - Line 76, it is currently:

Code:
if ( is_bool($escape))
{
   $this->_protect_identifiers = $escape;
}

I believe it should be:

Code:
if (! is_bool($escape))
{
   $this->_protect_identifiers = $escape;
}

I got the idea from looking at the _protect_identifiers method in /system/database/DB_driver.php


Hope someone finds this helpful?
#29

[eluser]skattabrain[/eluser]
i gotta say, i'm puzzled as to why we haven't seen a 1.7.1 so people can start using 1.7 without worries of this issue. Unless I'm wrong ... but is this still an issue for many?

using 1.7 on new projects, but not upgrading my past projects until this is in a core release.
#30

[eluser]thespy[/eluser]
[quote author="skattabrain" date="1231880045"]i gotta say, i'm puzzled as to why we haven't seen a 1.7.1 so people can start using 1.7 without worries of this issue. Unless I'm wrong ... but is this still an issue for many?

using 1.7 on new projects, but not upgrading my past projects until this is in a core release.[/quote]
Same here, I'm still on 1.6.3 due to this.




Theme © iAndrew 2016 - Forum software by © MyBB