I'm attempting to read from an odbc databases , and placing right into a mysql table, the below code in some way isn't working, even if I enter by hand values in to the query statement, can someone help?

function onAfterStoreUser($user, $isnew, $success, $msg)
   {   
      // do this for a newly added user only, not for a user being updated
      if ($isnew)
      {
     /* jimport('joomla.application.component.controller');
          global $mainframe;

          $user = JFactory::getUser();
          $username = $user->get('username');*/

       $uid = $user['id'];
       $database =& JFactory::getDBO();

       // Connect to my Server to pull exdtra information 

       $conn=odbc_connect('', '', '');
        if (!$conn){
            exit("Connection Failed: " . $conn);
}

  $sql = "SELECT * FROM dbo.dhru_demographics WHERE ID ='6759' " ;

if( !$sql ){     die(mysql_error()); 
}


$rs = odbc_exec($conn,$sql); 
if (!$rs)
{  

   exit("Error in SQL"); 

   }  
while ($row = odbc_fetch_array($rs))

    {  

     $state = $row["STATE"];    
     $zip = $row["ZIP"]; 


 } 

// INSERT INTO A SECOND TABLE.........

$thequery = "INSERT INTO `jos_employeeprofile` (`fname`, `lname`) VALUES ( 'test1', 'test2')";



         $database->setQuery($thequery);


         $result = odbc_exec($conn, $thequery); 



         if (!$database->query()) {
                      print("<font color=\"red\">SQL error: " . $database->stderr(true) . "</font><br />");

              }
          odbc_close($conn);
      }
   }

try

$thequery = "INSERT INTO jos_employeeprofile (fname, lname) VALUES ( 'test1', 'test2')";

Should you execute exactly the same query from phpMyAdmin, do you use it?