Welcome Guest, Not a member yet? Register   Sign In
using define in a SQL statement
#1

(This post was last modified: 10-02-2022, 05:49 PM by richb201.)

I am having trouble getting this to work. In index.php I have included
    //test temporary
    define ('TEMP_TEST', 'TEMPORARY');
//    define ('TEMP_TEST', '');

and in my model I have 
  $sql = "CREATE ".TEMP_TEST." TABLE ".$_SESSION['prefix']."key_temp
        SELECT sa.activity, a.risk,
              CASE WHEN
                                a.risk= 'HIGH' THEN 1
                                ELSE 1
              END AS qualified
        from activity a, standard_activities sa, relation r where a.email='$email' AND a.campaign='$_SESSION[campaign]' AND r.activity_id=a.id AND sa.standard_id=r.id";

I thought that TEMP_TEST would be replaced by TEMPORARY. It doesn't seem to work. Is TEMP_TEST not GLOBAL?
proof that an old dog can learn new tricks
Reply
#2

(10-02-2022, 05:48 PM)richb201 Wrote: I thought that TEMP_TEST would be replaced by TEMPORARY. It doesn't seem to work. Is TEMP_TEST not GLOBAL?

Yes, it is global.
TEMP_TEST should be replaced by TEMPORARY.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB