Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Sep 9th, 2010 | Syntax: PHP | Size: 0.83 KB | Hits: 26 | Expires: Never
Copy text to clipboard
  1. // get the title
  2. $com_id = "SELECT com_id from travelstories WHERE story_id = ".$story." ";
  3. $result3 = mysql_query($com_id);
  4. while ($row2 = mysql_fetch_array($result3)) {
  5.     $com_id = $row2["com_id"];
  6.  
  7. $ts_title = "SELECT topic_title from community_topics WHERE topic_id = ".$com_id." ";
  8. $result4 = mysql_query($ts_title);
  9. while ($row2 = mysql_fetch_array($result4 )) {
  10.     echo $row2['topic_title'];
  11. }
  12.  
  13. }
  14.  
  15. // get the story
  16. $com_id = "SELECT com_id from travelstories WHERE story_id = ".$story." ";
  17. $result5 = mysql_query($com_id);
  18. while ($row2 = mysql_fetch_array($result5)) {
  19.     $com_id = $row3["com_id"];
  20.  
  21. $ts_story = "SELECT post_text from community_posts WHERE topic_id = ".$com_id." ";
  22. $result6 = mysql_query($ts_story);
  23. while ($row3 = mysql_fetch_array($result6 )) {
  24.     echo $row3['post_text'];
  25. }
  26.  
  27. }