Re: trim string
| From: | Gary Huntress | Date: | Thu, 22 Mar 2001 00:18:30 +0000 |
| Subject: | Re: trim string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45033@lists.php.net to get a copy of this message | ||
Perform the trim as part of the query:
"Select rtrim(app_name) , rtrim( status) from approval_list where
doc_no='6'"
"Wen Ni Leong" <wnleong@mail.tke.po.my> wrote in message
news:3AB87DEB.A8E7D80F@mail.tke.po.my...
> I need help in this basic string function.
> I query from the database by using while loop and the result in in
> array. I separated them by using "," .
>
> I want at the end of the string to be trim off. Unfortunately I tried
> all the string function such as chop,trim and substr but they seem like
> can't manage to trim the end of the string. Please help me.
>
> my coding are:
>
> $db = mysql_select_db("tkenet_db");
> $query = "SELECT app_name,status FROM approval_list where doc_no='6'";
> $result = mysql_query($query,$db);
> while($data = mysql_fetch_row($result)){
>
> $cc .= $h->get_email($data[0]).",";
>
> if ($data[1] != 'Y')
> { $all_yes = 1;}
> }
> trim($cc);
>
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net