# %1$s ', chr($i)); } ?>

oops... something went wrong"; exit; } // Otherwise we connect to our Database mysql_connect("localhost", "munsing_karaoke", $pass) or die(mysql_error()); mysql_select_db("munsing_songbooks") or die(mysql_error()); // We preform a bit of filtering if ($begins == "num") { $sql = "SELECT * FROM karaoke WHERE title REGEXP '^[0-9]'" .$sqlExtra; } if ($begins !== "num") { $sql = "SELECT * FROM karaoke WHERE title LIKE '$begins%'" . $sqlExtra; } //Now we search for our search term, in the field the user specified $data = mysql_query($sql); //And we display the results //This is only displayed if they have submitted the form if ($begins !== "") { echo ""; } while(($result = mysql_fetch_array( $data )) !== false) { $i++; $artist = $result['artist']; $artist = strtoupper($artist); $artist = strip_tags($artist); $artist = trim ($artist); $artist = str_replace("'", "'", $artist); $title = $result['title']; $title = strtoupper($title); $title = strip_tags($title); $title = trim ($title); $title = str_replace("'", "'", $title); $songnumber = $result['songnumber']; //ECHO ROWS echo ""; echo ""; echo ""; echo ""; echo "\n"; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that if ($begins !== ""){ $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "

Sorry, but we can not find an entry to match your query

"; } mysql_close(); } } ?>
artist title number
".$artist."".$title."".$songnumber."