| 4232 | |
| 4233 | |
| 4234 | static void print_table_data_html(MYSQL_RES *result) |
| 4235 | { |
| 4236 | MYSQL_ROW cur; |
| 4237 | MYSQL_FIELD *field; |
| 4238 | |
| 4239 | mysql_field_seek(result,0); |
| 4240 | (void) tee_fputs("<TABLE BORDER=1>", PAGER); |
| 4241 | if (column_names) |
| 4242 | { |
| 4243 | (void) tee_fputs("<TR>", PAGER); |
| 4244 | while((field = mysql_fetch_field(result))) |
| 4245 | { |
| 4246 | tee_fputs("<TH>", PAGER); |
| 4247 | if (field->name && field->name[0]) |
| 4248 | xmlencode_print(field->name, field->name_length); |
| 4249 | else |
| 4250 | tee_fputs(field->name ? " " : "NULL", PAGER); |
| 4251 | tee_fputs("</TH>", PAGER); |
| 4252 | } |
| 4253 | (void) tee_fputs("</TR>", PAGER); |
| 4254 | } |
| 4255 | while ((cur = fetch_row(result))) |
| 4256 | { |
| 4257 | if (interrupted_query) |
| 4258 | break; |
| 4259 | ulong *lengths=mysql_fetch_lengths(result); |
| 4260 | field= mysql_fetch_fields(result); |
| 4261 | (void) tee_fputs("<TR>", PAGER); |
| 4262 | for (uint i=0; i < mysql_num_fields(result); i++) |
| 4263 | { |
| 4264 | (void) tee_fputs("<TD>", PAGER); |
| 4265 | if (opt_binhex && is_binary_field(&field[i])) |
| 4266 | print_as_hex(PAGER, cur[i], lengths[i], lengths[i]); |
| 4267 | else |
| 4268 | xmlencode_print(cur[i], lengths[i]); |
| 4269 | (void) tee_fputs("</TD>", PAGER); |
| 4270 | } |
| 4271 | (void) tee_fputs("</TR>", PAGER); |
| 4272 | } |
| 4273 | (void) tee_fputs("</TABLE>", PAGER); |
| 4274 | } |
| 4275 | |
| 4276 | |
| 4277 | static void |
no test coverage detected