Jono B Thu Feb 10 09:20:51 -0500 2011

Subject: Getting the sql string

Is it possible to get the sql string generated by a model?

I thought that the following would do the trick, but it doesnt seem to work.

$user = user_model::find(1);
$string = $user->to_string(); //or ->to_s() ?


Kien La Sun Feb 13 13:45:51 -0500 2011

Try user_model::table()->last_sql

(1-1/1)