Reputation: 141
Is there any possibilty to add a function-call in a SQL-Query?
At the moment i'm doing this:
§sql = "SELECT * FROM TABLE";
But I want, that I'm using a field from my table and call with this a function, which return me true or false.
Maybe a example could explain it better:
"$sql = SELECT * FROM TABLE WHERE functionCall(TABLE.FIELD)=true";
Then I just get all entrys from TABLE, where my function returns true.
Is there any possibility to do that?
Upvotes: 1
Views: 52
Reputation: 37233
you could use If condition before like that :
$sql = "SELECT * FROM TABLE";
fetch your query here
If(functionCall($row['FIELD'])==true) {
your wished code here
.......
}
Upvotes: 1