Jump to content

PHP queries


Guest rayomond

Recommended Posts

Posted

hi,

i am a novice in PHP and need some suggestions for the same. the IPB software is using PHP as the front end and MySQL as the backend. therefore if i want to create a listing of all the posts created in the database till date in the forum, how can i accomplish this using PHP?

in the database all the posts are stored in a table, therefore, the listing will include the posts, date on which they were created, user's name who created the posts and the thread in which they are created.


thanx in advance.

Rayomond.

Posted

hi,



i am a novice in PHP and need some suggestions for the same. the IPB software is using PHP as the front end and MySQL as the backend. therefore if i want to create a listing of all the posts created in the database till date in the forum, how can i accomplish this using PHP?



in the database all the posts are stored in a table, therefore, the listing will include the posts, date on which they were created, user's name who created the posts and the thread in which they are created.


thanx in advance.



Rayomond.



I do think its possible as I have seen this in other IPB software used forums but not very sure how its done.Very strange that no one has come up with any suggestion on the same.
Come on we are all here to seek support from you all.The tickets in the private forums remains unanswered and now the same thing is happening here also.
Can we look into this please?
Regards,
Philip
Posted

@phillipmorris....these forums are not our ticket system. We are in no way "required" to answer the topics in the forums, though many of the staff certainly make an effort to reply to these topics. This is not an issue we need to "look into", but rather an inquiry as to how a member can do something on his own, separate from the IPB software. :)

Unfortunately we cannot directly support users creating php documents on their own. I'm happy to provide assistance or insight, explanations, etc...but it is outside the scope of our support to help you create your own php applications.

That said, your MySQL query is going to look something like

SELECT t.*,p.* FROM ibf_topics t LEFT JOIN ibf_posts p ON (p.topic_id=t.tid) WHERE p.post_date < {insert_timestamp_here} ORDER BY p.post_date DESC LIMIT 0,{any_number}

In php you can get the {insert_timestamp_here} by calling time() and you can either remove the entire "LIMIT 0,{any_number}" statement to get all posts, or replace {any_number} with the maximum number of posts you wish to return.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...