CodeIgniter Forums
CodeIgniter v1.7.2 Released - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CodeIgniter v1.7.2 Released (/showthread.php?tid=22500)

Pages: 1 2 3 4 5


CodeIgniter v1.7.2 Released - El Forum - 09-15-2009

[eluser]Derek Jones[/eluser]
[quote author="Dimitar Velkov" date="1253040416"]how to make upgrade from 1.7.1. to 1.7.2
is there some instructions?[/quote]

http://ellislab.com/forums/viewreply/636281/


CodeIgniter v1.7.2 Released - El Forum - 09-15-2009

[eluser]phused[/eluser]
[quote author="Dregond Rahl" date="1252714385"]Awesome updates, tho i wish the upload class has a rewrite to solve the current problem.[/quote]

Same here. Hopefully it's fixed on the next update Smile


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]Farhan S. Basyaiban[/eluser]
good job for ellislab. but where is orm?


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]n0xie[/eluser]
[quote author="Farhan S. Basyaiban" date="1253099369"]good job for ellislab. but where is orm?[/quote]
There are several community libraries for this.


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]jedd[/eluser]
A lot of people talk about orm like it's an all-things-to-all-people solution to every-problem-you'll-ever-have.

There are, as has been pointed out, places you can grab an ORM plugin and get it cranked up in a few minutes. Happily, this satisfies the minority who prefer ORM, and the majority who don't, simultaneously.

Weirdly, no one seems to be crying out for a odbms enhancement to the database class, a back-end for db4o (etc).


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]ELRafael[/eluser]
Ok, good to see Cart class.

But there is something not in user guide.

http://ellislab.com/codeigniter/user-guide/changelog.html in the Database section there is this changes:
Quote:# Updated all database drivers to handle arrays in escape_str()
# Added escape_like_str() method for escaping strings to be used in LIKE conditions
# Updated Active Record to utilize the new LIKE escaping mechanism.

But there is a problem to me....

We have a CMS here, and the url created is dynamic.
So if I create a "menu" called "Something with spaces", the CMS creates the url link "something_with_spaces". Ok, fine.
But I still need the ID of this menu to open the content. So what I've done:
Code:
function title2id($title)
{
  $this->db->select('id');
  $this->db->like('title', $title);
  $query = $this->db->get($this->table);
  if ($query->num_rows() > 0)
  {
    $row = $query->row();
    return $row->id;
  }
  else
    return FALSE;
}
The sql generated:
Code:
SELECT `id` FROM (`modulo_menu`) WHERE `titulo` LIKE '%something\_with\_space'

Oh gosh, this is bad. I can't have this "\". I would like to have something like this:
Code:
LIKE '%something_with_space'

There is something to "tell" to NOT escape some query??

Thanks and sorry if this is the wrong place to put this question.


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]Derek Jones[/eluser]
Rafael, the phrase

Code:
LIKE '%something_with_space'

Would match

Code:
foosomethingawithzspace

Is that really what you want? % and _ must be escaped or else they will be wildcards.


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]ELRafael[/eluser]
[quote author="Derek Jones" date="1253127416"]Rafael, the phrase

Code:
LIKE '%something_with_space'

Would match

Code:
foosomethingawithzspace

Is that really what you want? % and _ must be escaped or else they will be wildcards.[/quote]

Yes sir!

Don't matter if there foosomethingawithzspace

Maybe my logic is wrong, I know. But we have so many websites here, there is a big pain change all this. What I've done was changed the line 710 in the file system/database/DB_active_rec.php. I put another param in the function like to check if I wanna espace or not. The default still escape.
I don't like this work-around cause the next upgrade of CodeIgniter.

I really need that wildcards.
I believe others maybe need the wildcards (% and _) in SQL querys (specially in LIKE).

Thanks for all Derek.


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]Derek Jones[/eluser]
Without this change, if you send the string '40%' (looking for forty percent) to AR like(), you'll return all manner of unwanted results. I can see the case to decide to shut this off manually, but by default, it absolutely should escape wildcard characters and not require the developer to do that.


CodeIgniter v1.7.2 Released - El Forum - 09-16-2009

[eluser]ELRafael[/eluser]
[quote author="Derek Jones" date="1253131565"]Without this change, if you send the string '40%' (looking for forty percent) to AR like(), you'll return all manner of unwanted results. I can see the case to decide to shut this off manually, but by default, it absolutely should escape wildcard characters and not require the developer to do that.[/quote]

Ok, thanks.

So, my question is, how can I shut this off manually, only for 1 case? The rest will be like is the default.