here iswhat I have so far:
Expand|Select|Wrap|Line Numbers
- <?php
- //connect to your database
- mysql_connect("localhost",$user,$pass); //(host, username, password)
- //specify database
- mysql_select_db($db) or die("Unable to select database"); //select which database we're using
- $result = mysql_query("SELECT * FROM RecentSearches ");
- // begin to show results set
- echo "<b><u>Results</b></u> <br/><br/><br/>";
- // now you can display the results returned
- while ($row= mysql_fetch_array($result)) {
- $title = $row["song_name"];
- $artist = $row["artist"];
- $Buy = $row["purchase_link"];
- echo "$title - " ;
- echo "$artist - " ;
- printf('<a href="%s" target="_tab">Buy this track</a>', $Buy);
- echo "<br/><br/>";
- }
- ?>