PDA

View Full Version : PHP implode is exploding my mind!!!!!!


Antivirus
16 Aug 2006, 21:45
What i want to do: pull all forum ids having a specific parent forum, and place them in a string ( $newsfeedforumids ) so they can be added to end of external.php lilke this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




My query:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Then I plug the $newsfeedforumids onto the end of external.php llike so:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



however there's 14 different forum ids supposed to be queried, and all i get attached to the end of the url is the first result as so:
bburl/external.php?type=rss2&forumids=7,7

What am i doing wrong?

Paul M
16 Aug 2006, 23:14
You are misunderstanding what mysql_fetch_array() does. This fetches one row of the result set as an array, not the entire result set. You need a 'while' loop to fetch the results row by row to build your array of forumids.

Antivirus
17 Aug 2006, 19:34
thanks Paul, this worked for me:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



would there have been a better way to do it than above?

Paul M
17 Aug 2006, 20:15
would there have been a better way to do it than above?
Not really.

Antivirus
17 Aug 2006, 20:36
cool, thanks again for the help!

Code Monkey
17 Aug 2006, 20:55
thanks Paul, this worked for me:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


would there have been a better way to do it than above?

Yes there would be if you want to be fully integrated. Use vBulletins $db->fetch_array. ;)



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Antivirus
23 Aug 2006, 23:34
good point Codemonkey, thanks!