600+ Topics = ID? (SQL Query)

Started by Rusconipepparoni, November 11, 2009, 04:14:21 AM

Previous topic - Next topic

Rusconipepparoni

Hey folks,

I've got about 600+ topics namned the same. Is there any quick way to get the ID of them all through an SQL Query or similiar as a list?

Please help me if you got any suggestion could it would be very time saving, otherwise I'll have to manually go through 600 topics and check for the ID.

Thank you!

Arantor

Which version of SMF and what's the name of the topics?

Rusconipepparoni

Quote from: Arantor on November 11, 2009, 07:01:43 AM
Which version of SMF and what's the name of the topics?

Board name = Loggbok
Forumversion = SMF 1.1.9

Sorry, it's board, not topics,

Yağız...

require_once('SSI.php');
$request db_query("SELECT ID_MSG AS id FROM {$db_prefix}messages WHERE subject = 'Loggbok'"__FILE____LINE__);
while (
$row mysql_fetch_assoc($request)) {
echo 
$row['id'] . '<br />';
}

Rusconipepparoni

Quote from: Yağız... on November 11, 2009, 01:24:44 PM
require_once('SSI.php');
$request db_query("SELECT ID_MSG AS id FROM {$db_prefix}messages WHERE subject = 'Loggbok'"__FILE____LINE__);
while (
$row mysql_fetch_assoc($request)) {
echo 
$row['id'] . '<br />';
}


Thanks. Even though I'm pretty sure that's for topics and not for boards as I correct myself, but now that I see how you've done it I guess I can apply it to boards instead by putting messages -> boards and ID_MSG -> ID_BOARD. But the code that you wrote shows up blank, I put it on /forum/, did I do something wrong?

<?php
require_once('/home/litec/public_html/vaxjostift/SSI.php');
$request db_query("SELECT ID_MSG AS id FROM {$db_prefix}messages WHERE subject = 'Loggbok'"__FILE____LINE__);
while (
$row mysql_fetch_assoc($request)) {
echo 
$row['id'] . '<br />';
}
?>

Arantor

If you want boards, instead of topics:

<?php
require_once('/home/litec/public_html/vaxjostift/SSI.php');
$request db_query("SELECT ID_BOARD FROM {$db_prefix}board WHERE name = 'Loggbok'"__FILE____LINE__);
while (
$row mysql_fetch_assoc($request)) {
  echo 
$row['ID_BOARD'] . '<br />';
}
?>

Advertisement: