...

View Full Version : array to string



rschoenbach
03-14-2007, 09:53 PM
I current have an array called $hole[].

the code is as follows:



$x=1;
$round_detail_string = "";
foreach ($hole as $value){
$round_detail_string += '(null,"'.$x.'","'.$value.'"),';
}
any ideas why this isnt adding the string to the string after it?

I am trying to create one long insert statement based on the values in the array.

Any suggestions?

Nightfire
03-14-2007, 10:04 PM
$round_detail_string .= '(null,"'.$x.'","'.$value.'"),';

It's a dot (.) to concentate (sp) strings, not a + :)

reashlin
03-14-2007, 10:04 PM
try


$round_detail_string .= '(null,"'.$x.'","'.$value.'"),';


.=

reashlin
03-14-2007, 10:05 PM
damn...nearly made it in time



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum