mercredi 21 mars 2018

Compare based on a stored variable

Maybe there is a topic about this, but I coudn't find.

I'm storing in a database a comparative operator and a target value, like:

$target_value_1 => 1000

$operator => greather_than_or_equal

Is there a way of using those operators in a variable like:

if ($variable1 $operator $target_value_1){

    // Some code

}

Working with PHP and MySQL.

Thanks

Aucun commentaire:

Enregistrer un commentaire