how can I do a do while php [closed]

-1

I need some support on php side I'm up to mysqli since xampp no longer supports mysql now supports MARIADB and needed to update do and the while .

Code:

<?php 
    do{?> 

    } 
    while ($row_DatosPost = mysql_fetch_assoc($DatosPost));
?>  

Solution

<?php do {
/* primera vez*/echo "hola";  while ($row_DatosUser = mysqli_fetch_assoc($DatosUser));?>

I hope you can contribute some idea that will help my problem. Grcias

    
asked by Matias 25.07.2017 в 17:39
source

2 answers

1

Just as you have it, it should work

<?php
do {
    /* primera vez*/

} while ($row_DatosPost = mysql_fetch_assoc($DatosPost));
?>
    
answered by 25.07.2017 / 17:47
source
1

With msqli it would be something like this:

$mysql = conectarBD(); //coneccion a la bd
    $sql="SELECT * FROM tabla";
    $resultado = $mysql->query($sql);
    while ($imprime=$resultado->fetch_assoc()) {        
     echo $imprime["nombre"];
    } 
    
answered by 25.07.2017 в 17:51