I'm running a database on a server that uses a version of MySQL before
4.1 so I can't do subqueries.  So I tried setting the following up:

$query1="SELECT DISTINCT outline_nr FROM tgs_brst_outline";

$result1=mysql_query($query1) or die("Unable to view data\n");

$query="SELECT tgs_saga.series_name, tgs_saga.season_nr,
tgs_story.story_nr, tgs_story.story_name, tgs_story.story_id
FROM tgs_story, tgs_saga, tgs_outline
WHERE (tgs_story.saga_nr = tgs_saga.saga_nr)
AND tgs_story.story_id NOT IN $result1
ORDER BY tgs_saga.series_name, tgs_saga.season_nr, tgs_story.story_nr";

$result=mysql_query($query) or die("Unable to view data1\n");
#echo "<p>GOT INTO DATABASE \n</p>";

I'm not quite sure why this idea doesn't work when I try running it.
I assumed that NOT IN could work with an array so I thought the
results of query1, being an array, would work for NOT IN.

Anybody have any ideas for workarounds in php to do subqueries when
the database doesn't support subqueries.  I hate the idea of having to
loop through the results of query1 to find out which story_id's
aren't in the other table.






Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




SPONSORED LINKS
Php mysql Job postings


YAHOO! GROUPS LINKS




Reply via email to