You are here: Re: [PHP] Creating INSERT INTO statement from dbf file « PHP « IT news, forums, messages
Re: [PHP] Creating INSERT INTO statement from dbf file

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация