I am trying to find corresponding text records for a category.
For example if I have the ID 5 for a “categorylinks” record, how would I find which texts go into that category?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: I’m still not sure if you are asking for the text of a category page or the text of the pages in a category so here’s both:
Text of a category page:
Text of a page in a category:
More explanation:
Basically, in categorylinks, the
cl_titleis the title of the category page. So you can look that up in the page table usingpage_titleandpage_namespace= 14 (the category namespace). Once you have the correct page, thepage_latestfield for that row equals therev_idin the revision table. This gives you the latest revision for the category page. The revision table has arev_text_idfield which equals theold_idfield in the text table.old_textin the text table is your text.Any time you want the text for a page it basically works like this. Find the page database record. Then:
page.page_latest = revision.rev_id and revision.rev_text_id = text.old_id.See also: The MediaWiki database schema.