daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. //Define an array to work with
  4. $names = array();
  5. $urls = array();
  6.  
  7.  
  8. $query_name = mysql_query("SELECT cat_name FROM exp_categories JOIN exp_category_posts ON exp_categories.cat_id = exp_category_posts.cat_id WHERE entry_id = '{embed:entry_id}' order by exp_categories.cat_id DESC");
  9. $query_url = mysql_query("SELECT cat_url_title FROM exp_categories JOIN exp_category_posts ON exp_categories.cat_id = exp_category_posts.cat_id WHERE entry_id = '{embed:entry_id}' order by exp_categories.cat_id DESC");
  10.  
  11. $count = '0';
  12.  
  13. while($count < '2'){
  14.   $result_name = mysql_result($query_name,$count);
  15.   array_push($names, $result_name);
  16.  
  17.   $result_url = mysql_result($query_url,$count);
  18.   array_push($urls, $result_url);
  19.  
  20.   echo "<a href='{site_url}/" . $urls[$count] . "'>" . "$names[$count]" . "</a>, ";
  21.   $count = $count + '1';
  22. }  
  23. $result_name = mysql_result($query_name,$count);
  24.   array_push($names, $result_name);
  25.  
  26.   $result_url = mysql_result($query_url,$count);
  27.   array_push($urls, $result_url);
  28.  
  29. echo "<a href='{site_url}/" . $urls[2] . "'>" . "$names[2]" . "</a>";
  30.    
  31. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top