I'm doing a MySQL query where one of the columns would be the result of a calculation.
However, I need to check by PHP if this account is valid. For example, pow (-0.2,0.5) would be an impossible value because it would be the same as trying to get the square root of a negative value. I have a problem too that in this field does not necessarily need to be an account, it might just come as the name of some table column.
I thought about using eval (), but it gives error for every time I do not insert an account but the name of a column.
Is there a way to validate if it is a possible calculation and, if it is a Any name, do nothing?
EX: select pow (-0.2,0.5), columnA, columnB from Table1 where name="John" would result in error since the first account is impossible. But it might come in the following format: select pow (columnA, columnB), columnA, columnB from Table1 where name="John" and in that case you would not have to check if it is a valid account.