Man, te recomiendo que leas MUCHOOOOOOOOOOOOOOOOOOOOO de PHP
Código PHP:
Ver original{
$cac="INSERT INTO moodle.mdl_user (id , auth ,confirmed ,policyagreed ,deleted ,mnethostid ,username ,password ,idnumber ,firstname ,lastname ,email ,emailstop ,icq ,skype ,yahoo ,aim ,msn ,phone1 ,phone2 ,institution ,department ,address ,city ,country ,lang ,theme ,timezone ,firstaccess ,lastaccess ,lastlogin ,currentlogin ,lastip ,secret ,picture ,url ,description ,mailformat ,maildigest ,maildisplay ,htmleditor ,ajax ,autosubscribe ,trackforums ,timemodified ,trustbitmask ,imagealt ,screenreader) VALUES (NULL , 'manual', '1', '0', '0', '1', '$row['Codigo']', '[cf735486ada2306b54c26debafc8d5ac]', '', '$nombre', '$apellido', '$email', '0', '', '', '', '', '', '', '', '', '', '', '$ciudad', '$pais', 'es_utf8', '', '99', '0', '0', '0', '0', '', '', '0', '', NULL , '1', '0', '2', '1', '1', '1', '0', '0', '0', NULL , '0')";
}
Te imprime algun error cuando haces eso ?
NOTA: Fíjese que cambie de lugar el mysql_query.