Re: DataObjects and SQL functions
| From: | Alan Knowles | Date: | Fri, 05 Dec 2003 10:38:19 +0000 |
| Subject: | Re: DataObjects and SQL functions | ||
| References: | 1 2 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-9311@lists.php.net to get a copy of this message | ||
If you really want to use the SQL functions you could try
$password = "test";
$x = new DataObjects_User;
$x->get(12);
$x->passwd = DB_DataObject_Cast::sql("PASSWD('{$password}')");
$x->update();
Jeroen Houben wrote:
Michael wrote:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comHi, I want to use the ->insert function of the DataObjects class, but one of the fields in my object is an password field, which has to be converted with the password() function of mysql. Is that possible with DataObjects ??Yes you can add a method to your class: function setMyPasswordField($string) { $this->myPasswordField = md5($string); } or something similar. If you want to use the mysql function it a little more complicated I think but not impossible I think HTH jeroen