Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host_db="localhost:3307";
- $user="root";
- $password="usbw";
- $db="desarrolloweb";
- if (!($conexion = mysql_connect($host_db, $user, $password)))
- die(mysql_error());
- if (!mysql_select_db($db, $conexion))
- die(mysql_error());
- ?>
- ------------------------
- <?php
- include("conexion.php");
- $result =mysql_query('SELECT * FROM persona',$conexion);
- if (!$result) {
- die ('Error en la query o no hay datos:'.mysql_error());
- }
- $lineas=mysql_num_rows($result);
- echo "Numero lineas:=".$lineas."<br>";
- echo "-----Fetch Array-----<br/>";
- while ($row = mysql_fetch_array($result))
- {
- // print_r($row);
- echo "<br/>";
- echo "------------------------<br/>";
- printf("Rut: %s ".
- "Nombre: %s".
- "Apellido Paterno: %s".
- "Apellido Materno: %s <br/>",
- $row['Rut'], $row['Nombre'],
- $row['ApellidoPat'],$row['ApellidoMat']);
- echo "<br/>";
- }
- mysql_close($conexion);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement