Error connecting to the MySql database

0

I try to connect to the Mysql database in PhpMyAdmin from php to fill a drop-down list but it does not fill up. Share php code:

Conexion.php

<?
$conexion = mysql_connect('localhost', 'root', '1234');
mysql_select_db('sistema_sms', $conexion);
?>

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema SMS</title>
<link href="../css/estilo.css" rel="stylesheet">
<script src="../js/jquery.js"></script>
<script src="../js/myjava.js"></script>
</head>
<body>
<header>
    ENVIAR SMS
</header>
<section>
<form id="enviar">
<table>
    <tr>
        <td>
            <select id="idPersona" name="idPersona">
                <option value="">Seleccione un numero del directorio</option>
                <?
                    include('../php/conexion.php');
                    $directorio = mysql_query("SELECT * FROM directorio ORDER BY persona_nombre");
                    while($opt = mysql_fetch_array($directorio)){
                        echo '<option value="'.$opt['persona_id'].'">'.$opt['persona_nombre'].'</option>';
                    }
                ?>
            </select>
            <br>
            <input type="text" maxlength="160" id="txtSMS" name"txtSMS" placeholder="Escribe aqui tu mensaje...">
        </td>
    </tr>
    <tr>
        <td><input type="submit" value="Enviar"/></td>
    </tr>
    <tr>
        <td id="respuesta" style="padding-top:10px;"></td>
    </tr>
</table>
</form>
</section>
</body>
</html>
    
asked by B.Torres 12.01.2018 в 23:52
source

0 answers