Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v1.7.2 Released
#31

[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/
#32

[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
#33

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

[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.
#35

[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).
#36

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

But there is something not in user guide.

http://ellislab.com/codeigniter/user-gui...gelog.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.
#37

[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.
#38

[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.
#39

[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.
#40

[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.




Theme © iAndrew 2016 - Forum software by © MyBB