I have three tables
artist
work
artist_nodes
A dynamic link goes from master page to a details page displaying all the particular artist's works, plus a number of keywords (nodes) associated with that artist.
I have no problem in making the details page show all the artist's works, but when i try to display the results from the artist_nodes table i run into problems. (Query was empty)
The code i am using is:
Artists Page
<?php include('Connections/immapp.php');
mysql_select_db($database_immapp, $immapp);
$query_rs_artist = "SELECT id_artist, 1stname_artist, 2ndname_artist FROM artist ORDER BY 2ndname_artist ASC";
$rs_artist = mysql_query($query_rs_artist, $immapp) or die(mysql_error());
$row_rs_artist = mysql_fetch_assoc($rs_artist);
$totalRows_rs_artist = mysql_num_rows($rs_artist);
?>
and then
<?php do { ?>
<a href="BALMORAL-artistdetail.php?recordID=<?php echo $row_rs_artist['id_artist']; ?>"><span class="artistname"></span><?php echo $row_rs_artist['1stname_artist']; ?> <?php echo $row_rs_artist['2ndname_artist']; ?></a><br>
<?php } while ($row_rs_artist = mysql_fetch_assoc($rs_artist)); ?>
And the details page....
<?php require_once('Connections/immapp.php'); ?>
<?php
$colname_rs_artist = "-1";
if (isset($GET['recordID'])) {
$colname_rs_artist = (get_magic_quotes_gpc()) ? $GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_immapp, $immapp);
$query_rs_artist = sprintf("
SELECT *
FROM artist,work, artist_nodes,
WHERE artist.id_artist = %s AND artist.id_artist = work.artistid_work ORDER BY year_work AND artist_nodes.artistID_artist_nodes= %s", $colname_rs_artist);
$rs_artist = mysql_query($query_rs_artist, $immapp) or die(mysql_error());
$row_rs_artist = mysql_fetch_assoc($rs_artist);
$totalRows_rs_artist = mysql_num_rows($rs_artist);
?>
i think the problem is in the syntax around ....
...AND artist_nodes.artistID_artist_nodes= %s
but, i am not sure
thx
jmt