fixed mysql tag to give values for ?# # and field name using #n.

This commit is contained in:
brad Arant committed 2024-11-27 15:37:58 -08:00
1 parent 6d2da98024
commit ae57e06778
5 files changed
+33 -13

No files matched your search

+16 -4
View File
@@ -30,8 +30,6 @@ namespace jet {
if(!mysql)
throw coreutils::Exception("database and host parameters are not valid.");
std::cout << "mysql: " << mysql << std::endl;
processContainer(container);
@@ -63,9 +61,23 @@ namespace jet {
}
coreutils::ZString __mysql::getColumnValue(coreutils::ZString column) {
if(column == "#")
return NbrOfRows;
MYSQL_FIELD *field;
if(column == "?#") {
nbrOfColumns = (int)qFields;
return nbrOfColumns;
} else if(column.ifNext("#")) {
if(column.eod()) {
nbrOfRows = (int)mysql_num_rows(result);
return nbrOfRows;
} else {
std::cout << "[" << column.unparsed() << "]" << std::endl;
int index = column.asInteger();
std::cout << "integer: " << index << std::endl;
field = mysql_fetch_field_direct(result, index - 1);
return coreutils::ZString(field->name);
}
}
for(int ix = 0; ix < qFields; ++ix) {
field = mysql_fetch_field_direct(result, ix);
if(column.equals((char *)field->name)) {