i am trying to knock out the last comma from db record but getting errors
pretty straight forward, i thought
error msg:Code:$query = "SELECT mycell FROM mytable WHERE id='1'"; $result = mysql_query($query); $row = mysql_fetch_row($result); $str = $row[0]; //$str = trim( preg_replace(''', "/'/", $str ) ); $str = substr($str,'',-1); echo $str . "\n";
andCode:Warning: substr() expects parameter 2 to be long, string given in
re: this fixed itCode:Warning: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: No ending delimiter '&' found in
re: fixed the last one w/ thisCode:$str = substr($str,0,strlen($str)-1);
Code:$str = trim( preg_replace('/'/', "'", $str ) );



Reply With Quote

Bookmarks