CD Mix Research Tool




[insert_php]
$servername=”localhost”;
$username=”quase_cdmix”;
$password=”ooeiynal8a”;

if(isset($_POST[‘submit’])){
if(isset($_GET[‘go’])){
if(preg_match(“/[A-Z | a-z]+/”, $_POST[‘query’])){
$query=$_POST[‘query’];
$db=mysql_connect ($servername, $username, $password) or die (mysql_error());
$mydb=mysql_select_db(‘quase_cdmix’);
echo “Search term: ” . $query . “

\n”;

//Searching CDMIX
$sql=”SELECT * FROM cdmix WHERE artist LIKE ‘%” . $query . “%’ OR song LIKE ‘%” . $query . “%’ OR cdxxx = ‘” . $query . “‘ OR trackxx = ‘” . $query . “‘”;
$result=mysql_query($sql);
echo mysql_num_rows($result) . ” results found in CDMIX\n
\n”;
echo “

\n

\n”;
while($row=mysql_fetch_array($result)){
$cd=$row[‘cd’];
$track=$row[‘track’];
$artist=$row[‘artist’];
$song=$row[‘song’];
echo “

\n”;
}
echo “

CD TK ARTIST SONG
” . $cd . “ ” . $track . “ ” . $artist . “ ” . $song . “

\n”;

//Searching OTHERS
$sql=”SELECT * FROM others WHERE folder LIKE ‘%” . $query . “%’ OR song LIKE ‘%” . $query . “%'”;
$result=mysql_query($sql);
echo mysql_num_rows($result) . ” results found in OTHERS\n
\n”;
echo “

\n

\n”;
while($row=mysql_fetch_array($result)){
$folder=$row[‘folder’];
$song=$row[‘song’];
echo “

\n”;
}
echo “

FOLDER SONG
” . $folder . “ ” . $song . “

\n”;

}else{
echo “Forgot something? Search for song, artist, trackxx or cdxxx”;
}
}
}
[/insert_php]