Re: remove last comma in string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



weetat wrote:
Hi all,

 I am using php 4.3.2 and mysql , linux.

 I have a sql statement below :

UPDATE tbl_chassis_temp SET country = 'Singapore', city 'SINGAPORE', building = 'Tampines Central 6', other = 'Level 03-40',

I need to remove the last comma from sql text above.
I have tried using substr and rtrim , without any success ?
Anyone have any suggestion ?

http://us2.php.net/manual/en/function.trim.php
trim: 4.1.0 The optional charlist parameter was added.

$str = "UPDATE tbl_chassis_temp SET country = 'Singapore', city 'SINGAPORE', building = 'Tampines Central 6', other = 'Level 03-40', ";
$str = trim($str, ', ');
print $str;

Dante

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux