|
Posted by Richard Lynch on 04/06/05 04:46
On Mon, April 4, 2005 1:33 pm, Rahul S. Johari said:
> It works fine, except for one problem. It¹s able to create the INSERT INTO
> sql statement, with all the fields and corresponding values, but as I¹m
> running a loop for both the fields names, and the values corresponding to
> fields names, it leaves a comma after the records are over.
If having a flag to determine when to add the , or ' feels too kludgy, you
could also do something like:
$values = array();
while ($value...){
$values[] = $value;
}
$values_sql = implode(", ", $values);
It's a bit more memory-intensive than just chopping up a string, but I
find it more understandable, personally. Others will differ, of course.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|