I want to say I am almost there. I can connect to the DB, I have a query stored and it runs fine and I can output the result into a table. But this is where I have hit a wall. Code Below:
$conn = mysqli_connect($db_host, $db_user, $db_pwd, $database);$result = mysqli_query($conn,$query) or trigger_error($querry . ' - has encountered an error at:<br />' . mysqli_error($conn));$fields = mysqli_fetch_fields($conn);$field_count = mysqli_num_fields($conn);echo '<table border="1" style="width:100%">' . "n" . '<tr>';$i = 0;foreach($fields as $field){ if(++$i == 1) { echo '<th colspan="' . $field_count . '">' . $field->table . '</th></tr><tr>'; }echo "n" . '<th>' . $field-name . '</th>';}echo '</tr>';while($row = mysqli_fetch_row($result)) { echo '<tr><td>' . implode('</td><td>' , $row) . '</td></tr>';}echo '</table>';
This gives me a nice table but it needs some formatting. Will do that with CSS later. My core concern is this: everything prints out but the column titles. I went looking through the mysqli_fetch functions to see if there was a fetch header or something similar but no dice. The mysql API had a field_name function. Does mysqli have something similar?
The second part of my question I might be able to figure out with enough poking around. I want the script to look at the value of the cell and if it meets the criteria it is edited in a specific way. For instance, if the contents of a cell starts with "HTTP" I want to put link tags around it. Is it possible?