Hey All,
This is a real GAS and all, but I'm really stuck!
I'm able to generate the array I need (which will vary in size from time to time) but can't figure out how to utilize it to create the INSERT I need.
$canvas_list_contacts =" select id from contacts where agency_name='FSBO'";
$result = @mysql_query ($canvas_list_contacts)or die ("Query failed"); // Run the query.
// convert result set into array
$array = array();
while ($row = mysql_fetch_assoc($result)) {
$array[] = $row[id];
} // while
// here's where I loose it...
// I'm thinking a foreach is involved
foreach ($array as $key => $value) {
$populate_canvas_list = "INSERT INTO prospect_lists_prospects (id, prospect_list_id,related_id,related_type,date_modified,deleted)
VALUES
('?', '4c1c90ac-e29d-b079-8c24-4550f759e92c','array[]','Contacts','now()','0'),
mysql_query( $populate_canvas_list);
}
Now, I don't THINK I need to populate ALL fields with this insert(date_modified or deleted could be null) but what about the 'id' field?
Anyway, any help would be greatly appreciated