DECIDED I used the answer from alfasin, but since it gave me too much information, I wrote a little script to just get the field names. Since the field names looked at first, it was pretty simple:
$here = array();
$SQL = "SHOW COLUMNS FROM User";
foreach($conn->query($SQL) as $row) {
$here[] = $row[0];
}
echo '<pre>';print_r($here);echo '<pre>';
This left me with a new aray $herecontaining column names, hope this helps someone in the future :)
original question: Let me explain a bit, I have a mysql table and I'm trying to select * from it and display the result in the html list <ol>. I can get JUST FINE string data. but I can't for the life of me figure out how to grab the column names of the table to match them with the row, respectively. this is my code that captures string data:
$sql = "SELECT DISTINCT *
FROM User
WHERE Owner = '".$owner."'";
foreach($conn->query($sql) as $row) {
$hax = count($row);
$halfHax = $hax / 2;
$u = 1;
for($i = 2; $i <= $halfHax; $i++){
echo $row[$u].'<br>';
$u++;
}
}
, Owner == $owner , , , , , /, . ?