Is there a nice simple way to get the amount of columns using perl and mysql? I generate the sql select code so i dont know how many columns are in there. I do have the column section isolated so a regex solution could be simple?
-edit- for the comment below.
"select " . col . " FROM " #more code
col = "a, b, c, d" #how do i find out if theres 4 columns?
query->column_count(); #returns 4
col = "a, b, c.c, d, e, f"
query->column_count(); #return 6 etc.