Welcome Guest, Not a member yet? Register   Sign In
Database custom sql select statement
#1

[eluser]mypmyp[/eluser]
Hello guys,

I'm completely newbie in CI and I'm confused a bit how can I complete a simple sql query:

SELECT title FROM titles WHERE DIFFERENCE(title, @my_search_param) > 2;

I have tried following:

$query = $this->db->get_where("titles", "title DIFFERENCE(title, '$q') > 2");

I have a feeling that there are no DIFFERENCE function in mysql...

Could you please advise, is there are any alternative in mysql for DIFFERENCE?
PS. I have found that SOUNDEX function is present, but simple comparison for 2 SOUNDEX expressions doesn't work for me.. (I have tried to compare SOUNDEX results, but query selected nothing:
$query = $this->db->get_where("titles", "SOUNDEX(title) = SOUNDEX('$q')");
)

Best regards,
mypmyp Smile


Messages In This Thread
Database custom sql select statement - by El Forum - 03-02-2011, 07:54 AM
Database custom sql select statement - by El Forum - 03-02-2011, 02:23 PM
Database custom sql select statement - by El Forum - 03-02-2011, 02:51 PM
Database custom sql select statement - by El Forum - 03-03-2011, 01:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB