+ Reply to Thread
Results 1 to 5 of 5

Thread: Searchable Music Library Catalog

  1. #1
    hoyer801 is offline x10Hosting Member hoyer801 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    23

    Searchable Music Library Catalog

    I'm trying to compile a database of the music libraries of three different schools within the same district. The idea is to put it in a mysql database and have a frontend page where the band directors would go and be able to browse, sort, and search through the data. I would also want them to be able to insert new titles as they go on. The fields would be rather simple -title, composer, grade leve, last date performed, and location.

    Can anyone suggest a ready-made (free or really cheap) php script for something like this? If not, if you could tell me essentially what needs to be done, I can certainly head over to w3schools and start working through their php tutorials.

    Someone else asked this same exact question a while back in a different forum but never really received an answer.

    Thanks in advance for any suggestions.
    Last edited by hoyer801; 10-10-2008 at 06:45 PM.

  2. #2
    Ainokea is offline x10 Sophmore Ainokea is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    127

    Re: Searchable Music Library Catalog

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>

    <form id="form1" name="form1" method="post" action="">
    <p align="center" class="title style1">PHP Article System</p>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="8%">Add Article</td>
    <td width="92%">&nbsp;</td>
    </tr>
    <tr>
    <td>Title</td>
    <td><input type="text" name="title" id="title" /></td>
    </tr>
    <tr>
    <td>Date</td>
    <td><input name="date" type="text" id="date" value="<?php echo $timestamp = date("m/d/Y"); ?>"></td>
    </tr>
    <tr>
    <td>Article</td>
    <td><label>
    <textarea name="article" id="article" cols="45" rows="5"></textarea>
    </label></td>
    </tr>
    <tr>
    <tr>
    <td>Short Summary</td>
    <td><label>
    <textarea name="summary" id="summary" cols="45" rows="5"></textarea>
    </label></td>
    </tr>
    <tr>
    <td> <div align="center">
    <input name="submit" type="submit" />
    </div></td>
    </tr>
    </table>
    <table width="100%" border="2" cellspacing="0" cellpadding="0">
    <tr>
    <td width="10%"><strong>Date</strong></td>
    <td width="11%"><strong>Title</strong></td>
    <td width="79%"><strong>Article</strong></td>
    </tr>
    <?php
    $title = $_POST["title"];
    $date = $_POST["date"];
    $article = $_POST["article"];
    $summary = $_POST["summary"];
    //get php article number retrieve from database along with comments
    function sql_connect ($database, $username, $password)
    {
    mysql_connect ('localhost', $username, $password) or die("Unable to connect");
    mysql_select_db($database) or die('Unable to find database');

    }


    sql_connect('ainokea_blog','username','password');
    $result = mysql_query('SELECT * FROM table ORDER by Date DESC') or die('Unable to find table');//This orders by date, you can remove the by

    $s=0;

    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    if($s==0)
    {
    echo '<tr> <td height="10%"><font color="#000000">'.$row['Date'];
    echo '</td> <td width="24%"><font color="#000000">'.$row['Title'];
    echo '</td> <td width="66%"><font color="#000000">'.$row['Article'];
    echo '</td></tr>';
    $s=1;
    }
    else
    {
    echo '<tr> <td height="10%" bgcolor="#000000"><font color="#FFFFFF">'.$row['Date'];
    echo '</td> <td width="24%" bgcolor="#000000"><font color="#FFFFFF">'.$row['Title'];
    echo '</td> <td width="66%" bgcolor="#000000"><font color="#FFFFFF">'.$row['Article'];
    echo '</td></tr>';
    $s=0;
    }
    }

    if($title != null)
    {
    echo $title."<br>";
    echo $date."<br>";
    echo $article."<br>";

    $query ="INSERT INTO `database`.`table` (`Title` ,`Summary` ,`Article`, `Date`)
    VALUES ('".$title."', '".$summary."' '".$article."', '".$date."');";
    mysql_query($query) or die("Unable to insert");
    }

    //add articles to database
    ?>
    </body>
    </html>
    heres an example, straight from my code I tested a while back... You just need to fool around with it and replace your table, database, username, password and fields.

  3. #3
    hoyer801 is offline x10Hosting Member hoyer801 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    23

    Re: Searchable Music Library Catalog

    Ainokea -

    Thanks for the script. That saved me a lot of time. I've been able to modify that to match my database and it's working pretty well so far.

    To anyone-

    How would you suggest that I allow users to choose the column that determines the sort order?

  4. #4
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: Searchable Music Library Catalog

    Clicking the column header is always intuitive.
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  5. #5
    hoyer801 is offline x10Hosting Member hoyer801 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    23

    Re: Searchable Music Library Catalog

    In the end, I found phpMyEdit and I'm using that now. Thanks for the suggestions.

+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  2. kPlaylist Music Library Script
    By darkangel1988 in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 01-25-2008, 03:15 PM
  3. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM
  4. Christian Music Radio looking for staff
    By Christopher in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 09-14-2006, 07:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers