Hi guys,
I'm querying a MySQL table to get some data that I display on a php page. The problem is that the col widths are small for a few columns. Is there any-way I can specifically change those (not the rest)?
Currently, I'm doing my printing via a loop, so it seems strange to me as to how to pin-point which corresponds to the coloumn. Do I maybe parse the contents and see make a decision on ?
Here's the code I am using:
$result = mysql_query("SELECT * FROM {$table}");
if (!$result) { die("Query to show fields from table failed"); }
$fields_num = mysql_num_fields($result);
echo "<table><tr>"; // Table headers
for($i=0; $i<$fields_num; $i++) {
$field = mysql_fetch_field($result);
echo "<td><b>{$field->name}</td></b>";
}
echo "</tr></th>\n"; // Table rows
while($row = mysql_fetch_row($result)) {
echo "<tr>";
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_result($result);
?>
</td> </tr> </table>