print select sql result in php

37

$result = $conn->query($sql);

$result = $conn->query($sql);
foreach($result as $row) {
    echo $row['column_name'];
}
$result = $conn->query($sql);
foreach($result as $row) {
    echo $row['column_name'];
}
foreach($result as $row) {
    //echo $row['column_name']; // Print a single column data
    echo print_r($row);       // Print the entire row data
}
// Process all rows
while($row = mysql_fetch_array($result)) {
    echo $row['column_name']; // Print a single column data
    echo print_r($row);       // Print the entire row data
}

Comments

Submit
0 Comments