To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-07-2004, 05:26 PM   #1
mabans
PHP Loser
 
mabans's Avatar
 
Join Date: May 2001
Location: San Diego California
Posts: 62
My Art display Part 2

I have evolved the art display is now working functionally but now it's within a 2 column views. I'm having some issues with 1 part of the code but I'm gonna address that on another topic in a different forum. but I want to know if this looks well done. I look forward to any and all input..


PHP Code:
<?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 //

        
        // This is the Artist Name //
        //I know this isn't working properly

        
."<!----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"
        
        
//I know this isn't working properly
        // 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";
?>
__________________
I really hate the fact I don't know PHP as much as I should, but I'm getting there.
mabans is offline   Reply With Quote
Reply

Bookmarks


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

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
Forum Jump


All times are GMT -4. The time now is 07:55 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.