Re: Turning a string into a condition
| From: | Marc Guay | Date: | Thu, 16 Feb 2012 20:38:32 +0000 |
| Subject: | Re: Turning a string into a condition | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316635@lists.php.net to get a copy of this message | ||
> It sounds like you have a string "$x < $y" in the database that you then
> replace into a string "4 < 5" which you want to test a conditional on. If
> this is the case, why are you storing conditionals in the database?
The user will be able to construct their own query strings, it's
complicated but necessary. The issue I'm dealing with, though, is
this:
$condition = "4 < 5";
if ($condition){
//do stuff
}