SQL query for extract data

Discussion in 'Databases' started by ironmankho, Oct 29, 2008.

  1. #1
    i have big collection of youtube video data indexing 48,582 in different categorize ...... now i want extract specific categorize video data in export to txt file ..... now i little bit confuses . how it is possible ? :confused:

    [​IMG]

    rapid help will be appreciate
     
    ironmankho, Oct 29, 2008 IP
  2. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #2
    I don't understand the sentence: from category 176 to vid1?

    Anyway I try to help with..what I understand about the current situtation:

    the script below select all videos of category id 176
    
    $query = mysql_query("SELECT * FROM your_table WHERE cat1=176");
    
    PHP:
    replace your_table with your table name

    So the txt part: (continue with the script above)
    
    while ($videos = mysql_fetch_assoc($query) ) {
    $content .= $videos['vid1']."\r\n";
    // this would save the url of the YT videos and seperate each of them by a newline
    // replace the \r\n by \n if your server is linux
    }
    
    // now save the string as txt
    $handle = fopen("your_filename.txt", "w");
    fwrite($handle,"$content");
    fclose($handle);
    
    
    PHP:
    Untested. Try if this helps? Its night here.. Good Night =)
     
    ads2help, Oct 30, 2008 IP
  3. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Thanks for help me ...................it works
     
    ironmankho, Oct 30, 2008 IP
  4. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Your're welcome. I said that i will help..in my store =D
     
    ads2help, Oct 30, 2008 IP
  5. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    SELECT COUNT( * ) AS `Rows` , `tags`
    FROM `y8`
    GROUP BY `tags`
    ORDER BY `tags`
     
    ironmankho, Jul 1, 2010 IP