Re: Problem inserting data field of type TEXT using DataObject..
| From: | Alan Knowles | Date: | Sat, 02 Apr 2005 12:30:19 +0000 |
| Subject: | Re: Problem inserting data field of type TEXT using DataObject.. | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-18485@lists.php.net to get a copy of this message | ||
can you find out why this is happening.
TXT type should also be STR type, so unless your column is BOOL and STR
and TXT you should not end up with '0'
Regards
Alan
On Fri, 2005-04-01 at 15:20 +0530, Kurund Jalmi wrote:
> hi all,
>
> i was trying to insert the one data field of type 'text'
>
> So instead of data, only '0' (zero) was inserted in the database.
>
> so i added some code in DataObject.php
>
> i added following code:
>
> if ($v & DB_DATAOBJECT_TXT) {
> $rightq .= $DB->quote($this->$k) . " ";
> continue;
> }
>
>
> after
>
> if ($v & DB_DATAOBJECT_STR) {
> $rightq .= $DB->quote(
> ($v & DB_DATAOBJECT_BOOL) ? (bool)$this->$k :
> $this->$k
> ) . " ";
> continue;
> }
>
>
> Now data is inserted correctly...
>
> Is this is right method to deal this problem???
>
> regards
>
> kurund jalmi