I have an art display project I'm working but I'm havig some issues with including the artist's name.
Iincluded an addtional query near the artist name. The query as well as addtional array defination goes as follows
$artist_sql = "SELECT * FROM `artist` WHERE ID=" .$poster['artist'];
$artist_results = mysql_query($artist_sql) or or die(mysql_error());
$artist_row = mysql_fetch_array($artist_result);
I included this right before I actually need the artist name which has been properly labeled below. I'm sure it's a syntax issue. Can someone explain the proper way to attack this?
link: http://69.13.156.225/test/includes/main_stage_items/results/thumbs.php?show_cat=1
FULL BLOWN SCRIPT
<?PHP
//The Required Files to access the data base
require("../../../includes/configs/config.cfg");
require("../../../includes/configs/select_db.cfg");
//The Required Files to access the data base
$columns = 2;
// Database Queries //
$poster_sql = "SELECT * FROM `poster` WHERE category=". $_GET['show_cat'] ." ORDER BY 'code' ASC LIMIT 60";
$result = mysql_query($poster_sql) or die(mysql_error());
$num_rows = mysql_num_rows($result);
echo "<TABLE BORDER=\"0\" WIDTH=\"99%\">\n";
for($i = 0; $i < $num_rows; $i++) {
$poster = mysql_fetch_array($result);
if($i % $columns == 0) {
echo "<TR>\n";
}
echo "<TD>"
// This display the image artwork//
."<!---- This display the image artwork--->\n"
."<table cellspacing=\"5\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"
."<tr>\n"
."<td align=\"left\" valign=\"top\" width=\"35\">\n"
."<a href=\"full_view.php?show_cat="
.$poster['ID']
."\">\n"
."\n<img src=\"../../../images/"
.$poster['imagethumb']
."\">\n"
."</a>\n</td>\n"
."<!---- This display the image artwork--->\n"
// This display the image artwork //
."<td align=\"left\" valign=\"top\" height=\"167\">\n"
// This is the information table with all the proper artwork info//
."<!---- This is the information table with all the proper artwork info --->\n"
."<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" height=\"136\" width=\"100%\">\n\n"
."<tr>\n\n"
// This is the art Item Code //
."<!----This is the art Item Code--->\n"
."<td>\n"
."<div class=\"unnamed1\">\n"
."<a href=\"full_view.php?show_cat="
.$poster['ID']
."\">\n"
.$poster['code']
."</a>\n"
."</td>\n"
."</tr>\n"
."<!----This is the art Item Code--->\n\n"
// This is the art Item Code //
// This is the Artwork Name //
."<!----This is the Artwork Name--->\n"
."<tr>\n"
."<td bgcolor=\"#eaeaea\">\n"
."<div class=\"unnamed1\">\n<font color=\"#000000\">\n"
.$poster['postername']
."</font>\n</div>\n"
."</td>\n"
."</tr>\n\n"
."<!----This is the Artwork Name--->\n";
// This is the Artwork Name //
$artist_sql = "SELECT * FROM 'artist' WHERE ID=" .$poster['artist'];
$artist_results = mysql_query($artist_sql) or die(mysql_error());
$artist_row = mysql_fetch_array($artist_result);
// This is the Artist Name //
echo "<!----This is the Artist Name--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\n"
.$artist_row['artistname']
.$artist_row['artistlastname']
."</div>\n"
."</td>\n"
."</tr>\n"
."<!----This is the Artist Name--->\n"
// This is the Artist Name //
// Poster Size Text //
."<!----Poster Size Text--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\nPaper Size:</div>\n"
."</td>\n"
."</tr>\n"
."<!----Poster Size Text--->\n"
// Poster Size Text //
."<!----Paper Size info--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\n"
.$poster['papersizeincheswt']
." x "
.$poster['papersizeinchesht']
." In | "
.$poster['papersizecmwt']
." x "
.$poster['papersizecmht']
." Cm"
."</div>\n"
."</td>\n"
."</tr>\n"
."<!----Paper Size Info--->\n"
// Paper Size Info//
// Image Size Text //
."<!----Image Size Text--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\nImage Size:</div>\n"
."</td>\n"
."</tr>\n"
."<!----Image Size Text--->\n"
// Image Size Text //
// Image Size Info//
."<!----Image Size Info--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\n"
.$poster['imagesizeincheswt']
." x "
.$poster['imagesizeinchesht']
." In | "
.$poster['imagesizecmwt']
." x "
.$poster['imagesizecmht']
." Cm"
."</div>\n"
."</td>\n"
."</tr>\n"
."<!----Image Size Info--->\n"
// Image Size Info//
// Pricing Info //
."<!----Pricing Info--->\n"
."<tr>\n"
."<td>\n"
."<div class=\"unnamed1\">\n"
."$"
.$poster['price']
."</div>\n"
."</td>\n"
."</tr>\n"
// Pricing Info //
."</table>\n"
."</td>\n"
."</tr>\n"
."</table>\n"
."<!----Pricing Info--->\n"
."<!---- This is the end of the information table with all the proper artwork info --->\n"
."</TD>\n";
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
echo "</TR>\n";
}
}
echo "</TABLE>\n";
?>