Progress.
One record added out of six test records.
Still experimenting ... but here is the current version of the code:
<?php
$bcount = get_blog_count();
global $wpdb;
$blogs = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'"));
if(!empty($blogs)){
?><ul class="menu"><?php
foreach($blogs as $blog){
$details = get_blog_details($blog->blog_id);
if($details != false){
$addr = $details->siteurl;
$name = $details->blogname;
$blognum = $details->blog_id;
if(!(($blog->blog_id == 1)&&($show_main != 1))){
?>
<li class="menu-item<?php if($counter == get_current_blog_id()){ echo ' current-menu-item';}?>">
Blog ID = <?php echo $blognum; ?><br />
Blog URL = <?php echo $addr; ?><br />
Blog Name = <?php echo $name;?><br />
<?php
$user_id_from_email = get_user_id_from_string( get_blog_option($blognum, 'admin_email'));
$current_site_admin = get_userdata($user_id_from_email);
?>
<?php $kw_fname = get_user_meta($current_site_admin, 'first_name', true); ?>
First Name: <?php echo $kw_fname ?><br />
<?php $kw_lname = get_user_meta($current_site_admin, 'last_name', true); ?>
Last Name: <?php echo $kw_lname ?><br />
<?php $kw_admin_email = get_bloginfo ( 'admin_email' ); ?>
Admin Email: <?php echo $kw_admin_email ?><br />
<?php $kw_practicename = get_user_meta($current_site_admin, 'practicename', true); ?>
Practice Name: <?php echo $kw_practicename ?><br />
<?php $kw_officephone = get_user_meta($current_site_admin, 'officephone', true); ?>
Office Phone: <?php echo $kw_officephone ?><br />
<?php $kw_officecity = get_user_meta($current_site_admin, 'officecity', true);?>
Office City: <?php echo $kw_officecity ?><br />
<?php $kw_officestreet = get_user_meta($current_site_admin, 'officestreet', true); ?>
Office Address: <?php echo $kw_officestreet ?><br />
<?php $kw_officestateprovince = get_user_meta($current_site_admin, 'officestateprovince', true); ?>
Office State: <?php echo $kw_officestateprovince ?><br />
<?php $kw_officepostcode = get_user_meta($current_site_admin, 'officepostcode', true); ?>
Office Zip: <?php echo $kw_officepostcode ?><br /><br /><br />
</li>
<?php
}
}
}
?></ul><?php
}
$data = array(
'sl_store' => $kw_practicename,
'sl_address' => $kw_officestreet,
'sl_address2' => '',
'sl_city' => $kw_officecity,
'sl_state' => $kw_officestateprovince,
'sl_zip' => $kw_officepostcode,
'sl_country' => 'USA',
'sl_latitude' => '',
'sl_longitude' => '',
'sl_tags' => '',
'sl_description' => '',
'sl_email' => '',
'sl_url' => $addr,
'sl_hours' => '',
'sl_phone' => '',
'sl_image' => '',
'sl_private' => NULL,
'sl_neat_title' => NULL,
'sl_linked_postid' => NULL,
'sl_pages_url' => NULL,
'sl_pages_on' => NULL,
'sl_lastupdated' => current_time('mysql', 1),
'sl_fax' => '',
'sl_option_value => NULL
);
$wpdb->insert(wp_store_locator, $data);
?>
I'm thinking that I have the wpdb code placed outside of the foreach loop. Now to find it.