This may be dumb but I've been beating my head against it for a bit now..
$values contains this text:
'58','val','val','val','2011-05-12 21-41-42','','0','micahstesttest',
Why won't this trim the last comma?
trim($values, ",");
EDIT - this is how $values is being generated:
$values = "";
foreach($users_table as $k=>$v){ $values .= "'$v',"; }
trim($values, ",");