Basically I have an artist page which shows name, biography and pic. I would like to have links that displays this content for all the artist.
I guess I am trying to pass a table or field(s) through a link as a variable(I assume) so I can then display dynamic content when a person selects a particular link.
To be more specific my index.php will have specific artist links on the left. When a person clicks on a specific link it will pass specific information about that artist to artist_description.php.
My database name is artist_info:
The table name is artist:
The fields are:
artist_id primary key
name
biography
url_tnimage (this is for the link to the image)
Here is what I have so far for my index.php:
<?php require_once('Connections/connhardlife.php'); ?>
<?php
mysql_select_db($database_connhardlife, $connhardlife);
$query_Recordset1 = "SELECT * FROM artist_info";
$Recordset1 = mysql_query($query_Recordset1, $connhardlife) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
This is where I am trying to pass the information:
<a href='artist_description.php?id=$row[artist_id]'>artist name</a>
So my question; is this link the rite way to pass information and how would I set up the artist_description.php page so that I can display all my information from my database.
Here is where I think I should go with it:
<?php require_once('Connections/connhardlife.php'); ?>
<?php
mysql_select_db($database_connhardlife, $connhardlife);
$query_Recordset1 = "SELECT * FROM artist_id WHERE RecordKey = '" . $_GET['id'] . "'";
$Recordset1 = mysql_query($query_Recordset1, $connhardlife) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
I am not too sure though.
This coding was generated in dreamweaver mx 4(recent version) so it is sort of different from what I usually see. The last coding on the index.php ends here:
<?php
mysql_free_result($Recordset1);
?>
Any help would be very much appreciated. Thank you
ken