[insert_php]
$servername = “localhost”;
$username = “itchonta_webmast”;
$password = “767pkNMp8v”;
$dbname = “itchonta_incubadora”;
// Crea la conexion
$conn = new mysqli($servername, $username, $password, $dbname);
// Verifica la conexion
if ($conn->connect_error) {
die(“Conexion Fallida: ” . $conn->connect_error);
}
/* cambiar el conjunto de caracteres a utf8 */
if (!$conn->set_charset(“utf8”)) {
printf(“Error cargando el conjunto de caracteres utf8: %s\n”, $conn->error);
} else {
// printf(“Conjunto de caracteres actual: %s\n”, $conn->character_set_name());
printf(“”, $conn->character_set_name());
}
$sect = “Select DISTINCT Sector FROM ci_catalogo_scian ORDER BY id_scian”;
$result = $conn->query($sect);
if ($result->num_rows > 0){
echo’
‘;
}else{
echo “
No se encontro ningún registro, Por favor contacte al administrador del sistema
“;
}
$sub = “Select DISTINCT Subsector FROM ci_catalogo_scian WHERE Sector=’$sector’ ORDER BY id_scian”;
$result2 = $conn->query($sub);
if ($result2->num_rows > 0){
echo’
‘;
}else{
echo “
No se encontro ningún registro, Por favor contacte al administrador del sistema
“;
}
[/insert_php]