Jump to content

aphex_

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aphex_'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here is what I am doing and it is working - $x='somestring'; $y='someotherstring'; $operator = '=='; $condition="if ($x $operator $y) { echo "We gotta match!\n"; }"; eval("$condition"); Thanks Again!
  2. I just wanted to thank the last responder for their suggestion to use the eval() function. I have managed to get it partially working with this and that has been the best answer anyone has given me to this question so far. -Aphex
  3. Well, I will be storing the operators in database fields in a table. This table will also store the column name that is being checked and the variable it is being compared with. Basically, this will allow end users to write rules so that if text fields meet certain conditions they are notified by email. A real world example would be so that if a car sale is made for over $50,000 the boss is notified. In this case the column name might be sale_amount and the comparison variable $50,000. The operator database field obviously would be '>='; So when a new row is injected in the database recording a car sale, the rules table is checked, and if the sale amount is over 50k, the boss is notified.
  4. I am attempting to make an operator in an if conditional a variable like so: $x=1; $y=2; $operator='!='; if ($x $operator $y) { echo "Not equal!\n"; } But obviously that doesnt work. Does anyone know if something like this is achievable and how? [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Any help would be appreciated. Thanks, Aphex_
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.