Searchable Music Library Catalog

hoyer801

New Member
Messages
23
Reaction score
0
Points
0
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:

Ainokea

New Member
Messages
127
Reaction score
0
Points
0
<!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.
 

hoyer801

New Member
Messages
23
Reaction score
0
Points
0
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?
 

hoyer801

New Member
Messages
23
Reaction score
0
Points
0
In the end, I found phpMyEdit and I'm using that now. Thanks for the suggestions.
 
Top