Jump to content

Insert array variables in foreach to MySQL


hybmg57

Recommended Posts

Hi,

 

I was wondering if there was a way to insert array variables inside foreach to MySQL.

 

Below is my code so far but it doesn't work.

 

Thank you.

 

<?php
include ('db.php');
include ('mls.php');

soapImportNWMLS("Listing","Residential","2010-11-20T00:00:00","2010-11-23T23:59:59","","","","");

foreach($dataArray[RESI][Residential] as $data){
foreach($data as $key1 => $data1){

echo $key1." = ".$data1."<BR><BR>";
$key1=array($key1);
$data1=array($data1);
}
print_r($key1);
mysql_query("INSERT INTO RESI ($key1) VALUES($data1)")
or die(mysql_error());
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.