×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Mysql mp3: Difference between revisions

    Content added Content deleted
    imported>mutante
    mNo edit summary
    No edit summary
    Line 1: Line 1:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
    #REDIRECT [[HowTo/MakeYourOwnMp3Database]]
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>
    My Muzak
    </title>
    <style type="text/css">
    <!--
    body {
    background-color: #332255;
    color: #aaaa00;
    }
    table {
    width:100%;
    empty-cells: show;
    }
    td { border:1px solid #000; vertical-align:top; overflow:hidden; white-space: nowrap;}
    th { border:2px solid #000; vertical-align:top; overflow:hidden; }
    input {
    background-color: #000000;
    color: #00aa00;
    }
    select {
    background-color: #000000;
    color: #00aa00;
    }

    -->
    </style>
    </head>
    <body>
    <table>
    <tr><th colspan="3">my muzak db v0.23</th></tr>
    <tr><td colspan="3">
    <?php
    echo "My name is Sirius.</td></tr><tr><td colspan=\"3\">Hello, fnord from ".$_SERVER['REMOTE_ADDR'].", you are using ".$_SERVER['HTTP_USER_AGENT']."</td></tr>";
    echo "<tr><td colspan=\"3\">My IP / hostname is: ".$_SERVER['SERVER_NAME']."</td></tr>";
    ?>
    <tr><td colspan="3">
    <form action="index.php" method="post">
    <p>
    search for:
    <input type="text" id="what" name="what" size="23" />
    in
    <select name="where" id="where">
    <option value="filename">filename</option>
    <option value="artist">artist</option>
    <option value="title">title</option>
    <option value="album">album</option>
    <option value="comment">comment</option>
    <option value="year">year</option>
    <option value="genre">genre</option>
    <option value="path">path</option>
    <option value="copyright">copyright</option>
    <option value="stereo">stereo</option>
    <option value="frequency">frequency</option>
    </select>
    <input type="submit" value="Go" />
    </p>
    </form>
    </td></tr>
    <tr><td colspan="3">
    <?php

    $db="muzak";
    $link = mysql_connect("localhost","fnord","ownzya");
    # no, this is not my real pass :)

    if (! $link)
    die("Couldn't connect to MySQL");
    mysql_select_db($db , $link)
    or die("Couldn't open $db: ".mysql_error());

    if (isset($_POST["what"])) {
    $what = $_POST["what"];
    } else {
    $what="fnord";
    }
    if (isset($_POST["where"])) {
    $where = $_POST["where"];
    } else {
    $where="filename";
    }

    $result=mysql_query( "SELECT * FROM muzak where $where LIKE '%$what%'" );

    $num=mysql_num_rows($result);

    echo "Searched for <b>$what</b> in <b>$where</b>. $num files found.</td></tr>";

    echo "<tr><th></th></tr><tr><th>id</th><th>filename</th><th>artist</th><th>title</th><th>album</th><th>comment</th><th>track</th><th>year</th><th>genre</th><th>path</th><th>filesize</th><th>copyright</th><th>layer</th><th>stereo</th><th>goodframes</th><th>badframes</th><th>frequency</th><th>playtime</th></tr>";

    while($row = mysql_fetch_array($result)) {
    echo "<tr><td>".$row["id"]."</td><td>".$row["filename"]."</td><td>".$row["artist"]."</td><td>".$row["title"]."</td><td>".$row["album"]."</td><td>".$row["comment"]."</td><td>".$row["track"]."</td><td>".$row["year"]."</td><td>".$row["genre"]."</td><td>".$row["path"]."</td><td>".$row["filesize"]."</td><td>".$row["copyright"]."</td><td>".$row["layer"]."</td><td>".$row["stereo"]."</td><td>".$row["goodframes"]."</td><td>".$row["badframes"]."</td><td>".$row["frequency"]."</td><td>".$row["playtime"]." s</td></tr>";
    }
    echo "</table>";
    mysql_close();


    ?>
    </body>
    </html>

    Revision as of 21:32, 29 June 2006

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> My Muzak </title> <style type="text/css"> </style> </head> <body>

    "; echo "";

    ?>

    "; echo "";

    while($row = mysql_fetch_array($result)) {

    echo "";
     }
    
    echo "
    my muzak db v0.23

    <?php

    echo "My name is Sirius.
    Hello, fnord from ".$_SERVER['REMOTE_ADDR'].", you are using ".$_SERVER['HTTP_USER_AGENT']."
    My IP / hostname is: ".$_SERVER['SERVER_NAME']."

    <form action="index.php" method="post">

    search for: <input type="text" id="what" name="what" size="23" /> in <select name="where" id="where"> <option value="filename">filename</option> <option value="artist">artist</option> <option value="title">title</option> <option value="album">album</option> <option value="comment">comment</option> <option value="year">year</option> <option value="genre">genre</option> <option value="path">path</option> <option value="copyright">copyright</option> <option value="stereo">stereo</option> <option value="frequency">frequency</option> </select> <input type="submit" value="Go" />

    </form>

    <?php

    $db="muzak"; $link = mysql_connect("localhost","fnord","ownzya");

    1. no, this is not my real pass :)

    if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());

    if (isset($_POST["what"])) { $what = $_POST["what"]; } else { $what="fnord"; } if (isset($_POST["where"])) { $where = $_POST["where"]; } else { $where="filename"; }

    $result=mysql_query( "SELECT * FROM muzak where $where LIKE '%$what%'" );

    $num=mysql_num_rows($result);

    echo "Searched for $what in $where. $num files found.
    idfilenameartisttitlealbumcommenttrackyeargenrepathfilesizecopyrightlayerstereogoodframesbadframesfrequencyplaytime
    ".$row["id"]."".$row["filename"]."".$row["artist"]."".$row["title"]."".$row["album"]."".$row["comment"]."".$row["track"]."".$row["year"]."".$row["genre"]."".$row["path"]."".$row["filesize"]."".$row["copyright"]."".$row["layer"]."".$row["stereo"]."".$row["goodframes"]."".$row["badframes"]."".$row["frequency"]."".$row["playtime"]." s

    ";

    mysql_close();


    ?> </body> </html>

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.