Hi

I need to fill a variable a value (writers name) with the data coming from 2 different 
tables depending on the choice from the previosu page (add a new article or edit an 
old one). Is their an easier way to do this as the sql is rather ugly that I am using 
later as itis not clean in its choice giving extra records. 


if (isset($writer))     //for a new story
   $n = get_writer_name($writer);
elseif (isset($story))   // edit old article
   $s = get_story_record($story);

later in page...

 print query_select("page", 
             "select p.code, p.description 
              from pages p, writer_permissions w
              where p.code = w.page
              and w.writer = '$s[writer]' or w.writer = '$n[writer]'", $s[page]);?>

ANdreww

ta 

Andy

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to