Hi all, i’m a total newbie and i know very little about coding, but i’m beating my way through learning. I’m having a little problem working out how to do the following, as i probably don’t know the correct terminology. So basically i have a database loaded with Karaoke Album Details : fields are Artist, Title, Description, DiscNo, TrackNo.
I have managed to create a query to display DiscNo in a simple table like below …
What i would like to do is then have each of the DiscNo clickable to either expand on page or link to a popup to show all of the associated fields ie TrackNo, Artist etc … Any help or direction would be greatly appreciated.
[php]<?php
$dbhost = ‘localhost’;
$dbuser = ‘’;
$dbpass = '’;
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’);
$dbname = ‘*******’;
mysql_select_db($dbname);
// Formulate Query
// This is the best way to perform a SQL query
// For more examples, see mysql_real_escape_string()
$query = sprintf(“SELECT DISTINCT DiscNo FROM CDG ORDER BY DiscNo ASC”);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ’ . mysql_error() . “\n”;
$message .= 'Whole query: ’ . $query;
die($message);
}
echo "
Disc No |
---|
” . $row[‘DiscNo’] . “ | ”;
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?> [/php]