Welcome Guest, Not a member yet? Register   Sign In
Active Record: Insert / update on exist
#11

[eluser]Samus[/eluser]
[quote author="Stefan Hueg" date="1336435897"]I don't know if that works as I've never extended database classes, but here is a perfect solution. I just googled a bit:

http://dev.mysql.com/doc/refman/5.1/en/replace.html

With this you can just build your own replace_batch function and make us all happy Smile[/quote]
Just beautiful.
#12

[eluser]Samus[/eluser]
For anyone else that may come across this problem, i've just been digging my nose in the core files and i've just noticed the replace method is already there and working.

strange huh, wonder why this isn't in the documentation.
#13

[eluser]InsiteFX[/eluser]
Read the CodeIgniter Users Guide! You cannot extend the database class!

#14

[eluser]Samus[/eluser]
[quote author="InsiteFX" date="1336446467"]Read the CodeIgniter Users Guide! You cannot extend the database class!

[/quote]
I didn't need to. The functionality was already there..
#15

[eluser]Stefan Hueg[/eluser]
system/database/DB_active_rec.php
Code:
public function replace($table = '', $set = NULL)
{
...
}

It's not documented as Samus has posted.

Great discovery btw. Smile
#16

[eluser]InsiteFX[/eluser]
Right, but this is one reason I tell everyone when your finished read the CodeIgniter Users Guide,
start exploring the CodeIgniter classes.

Lot's of stuff in them that is not documented.




Theme © iAndrew 2016 - Forum software by © MyBB