Current location: Hot Scripts Forums » Programming Languages » PHP » Passing a table or variable through a link?


Passing a table or variable through a link?

Reply
  #1 (permalink)  
Old 12-06-03, 02:48 AM
chinablack1480 chinablack1480 is offline
New Member
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Passing a table or variable through a link?

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
Reply With Quote
  #2 (permalink)  
Old 12-07-03, 03:55 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
yes , this is the correct way to do what you want ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a variable name dynamically Kenrette ASP 2 11-12-03 09:48 AM
PAssing variables dbalka Perl 3 10-29-03 05:00 PM
Different type of link counter mdhall Script Requests 2 10-10-03 01:19 PM
moving data from table to table ..please help! geneane ASP 2 09-22-03 07:02 PM
Array passing between functions alfreds PHP 1 08-25-03 05:29 AM


All times are GMT -5. The time now is 06:08 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.