cant figure out why i'm getting this error:

Warning: implode() [function.implode]: Invalid arguments passed in C:\Users\Travis\Documents\choicegrid\dam_spp.php on line 67

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>


$url = "";  // The simple url
$name = "_dam_spp.html";                        // The parameter name
$date = date("Ymd");
//$date = date("Ymd",time()+60*60*24);       // The parameter value
$newUrl = $url . "$date$name";        // appending the values

//echo $newUrl;

	$html = file_get_html ($newUrl);

	// get the table. Maybe there's just one, in which case just 'table' will do
// Displays Extra Debug Info
$dbg = 1;
// Read DOM

// get the table. Maybe there's just one, in which case just 'table' will do
//$table = $html->find('#theTable');
// initialize empty array to store the data array from each row
$theData = array();

// loop over rows
foreach ($html->find('table') as $table) {

foreach($table->find('tr') as $row) {
// initialize array to store the cell data from each row
$rowData = array();
foreach($row->find('td') as $cell) {
// push the cell's text to the array
$rowData[] = $cell->plaintext;
// push the row's data array to the 'big' array
$theData[] = $rowData;



foreach ($theData as $rows => $newData) {
	echo "<b>$rows</b><br>";
	foreach ($newData as $key => $value){
	echo "$key - $value<br>";
  $astring = implode("', '", $value);
$astringTwo = "'".$astring."'";
 echo "astringTwo <br>";

'your', 'string', 'should', 'appear', 'like', 'this'


your first arg in implode should be implode('\', \'', $value);

string implode ( string $glue , array $pieces )
string implode ( array $pieces )

from PHP Manual


$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);

echo $comma_separated; // lastname,email,phone

// Empty string when using an empty array:
var_dump(implode('hello', array())); // string(0) ""


Thanks, I was able to actually solve it with a For Statement.

$comma_separated = implode("','", $rs);

@mysql_select_db($database) or die( "Unable to select database");

$astringTwo = "'".$comma_separated."'";

mysql_query("replace into dam_spp VALUES('$rs[1]',".$astringTwo.") ");

Thank you for your help.