Jump to content

cbm3384

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cbm3384's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How do I get this query to return a single row, of no significance, if the second subquery equals zero? (And still return what it does now if the second subquery > 0) select tasks.task_id from tasks, stages where tasks.job_id=1111 and tasks.stage_id=stages.stage_id and stages.stage_num=( and (select count(task_id) from tasks where start_date is not null and job_id=1111)=(select count(task_id) from tasks where job_id=1111) Thanks, Chris
  2. I figured it out. I stored the query string in the database: select salesman from jobs where salesman is not NULL and job_id='".$this->job_id."' limit 1 I retrieved and eval'd it: eval("\$query = \"$query\";"); I executed it: $res = mysql_query($query)or die(mysql_error());
  3. I am building a project that requires I store query strings in a table (stage_reqs) which are called to determine permissions. These strings will look something like this: select salesman from jobs where salesman is not NULL and job_id='".$this->job_id."' limit 1 The variable value needs to be determined from within the function it is being accessed in. Can I use eval to do this? Thanks, Chris
×
×
  • 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.