SOLVED
Is there a manner to echo out each row from an SQL query without calling them with their names?
$result = mysql_query("SELECT * FROM testtable");
$res = mysql_fetch_array($result);
echo "<pre>";
print_r($res);
echo "</pre>";
here my solution
$query = "SELECT * FROM usr WHERE usr_id = $user_id";
$result = mysql_query($query);
$results = mysql_num_rows($result);
for($i=0; $i
$records=mysql_fetch_assoc($result);
?>
<table class="table table-striped table-responsive">
<thead>
<th>Name</th>
<th>Value</th>
</thead>
<tbody><?php
foreach($records as $item=>$val){
?>
<tr>
<?php
$a = array( "id",
"first_inlog",
"last_inlog",
"reg_date",
"reg_ip",
"reg_info");
echo '<td>'.$item.'</td>';
if (in_array($item, $a)){
echo '<td> <input class="form-control" type="text" name="fname" value="'.$val.'" disabled></td>';
}else{
echo '<td> <input class="form-control" type="text" name="fname" value="'.$val.'"></td>';
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>