Rpgmaster's Profile User Rating: -----

Reputation: -8 Shunned
Group:
Banned
Active Posts:
18 (0.03 per day)
Joined:
22-November 12
Profile Views:
483
Last Active:
User is offline Dec 01 2012 06:06 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Rpgmaster has not set their status

Posts I've Made

  1. In Topic: How to display specific product from the table

    Posted 24 Nov 2012

    <?php 
    // Script Error Reporting
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    ?>
    <?php 
    // Run a select query to get all items
    // Connect to the MySQL database  
    include "connect.php"; 
    $dynamicList = "";
    $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC ");
    $productCount = mysql_num_rows($sql); // count the output amount
    if ($productCount > 0) {
    	while($row = mysql_fetch_array($sql)){ 
                 $id = $row["id"];
    			 $product_name = $row["product_name"];
    			 $price = $row["price"];
    			 $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
    			 $dynamicList .= '<table width="100%" border="0" cellspacing="0" cellpadding="6">
            <tr>
              <td width="17%" valign="top"><a href="product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a></td>
              <td width="83%" valign="top">' . $product_name . '<br />
                $' . $price . '<br />
                <a href="product.php?id=' . $id . '">View Product Details</a></td>
            </tr>
          </table>';
        }
    } else {
    	$dynamicList = "We have no products listed in our store yet";
    }
    mysql_close();
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Products</title>
    <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
    </head>
    <body>
    <div align="center" id="mainWrapper">
      <?php include_once("template_header.php");?>
      <div id="pageContent">
      <?php echo $dynamicList; ?>
      </div>
      <?php include_once("template_footer.php");?>
    </div>
    </body>
    </html>
    


    For the coding above i can display all the products from the PRODUCTS TABLE. How i must change to just display the selected product from specific category column & subcategory column of my table. The database table screenshot as below
    [/quote]
  2. In Topic: Please help me in this graphic!

    Posted 23 Nov 2012

    Posted Image

    The code must be build using the following algorithms

    	void drawLine(Graphics g, int x1, int y1, int x2, int y2) {
    
    	int dx = x2 - x1;
    	int dy = y2 - y1;
    	putPixel(g, x1, y1);
            
    	if (Math.abs(dx) > Math.abs(dy)) {
     		float m = (float) dy / (float) dx;
    		float b = y1 - m*x1;
     		dx = (dx < 0) ? -1 : 1;
    
    		while (x1 != x2) {
     			x1 += dx;
    			putPixel(g, x1, Math.round(m*x1 + B)/>/>/>/>);
    		}
    	} else	if (dy != 0) {
    		float m = (float) dx / (float) dy;
    		float b = x1 - m*y1;
    		dy = (dy < 0) ? -1 : 1;
    		while (y1 != y1) {
    			y1 += dy;
    			putPixel(g, Math.round(m*y1 + B)/>/>/>/>, y1);
    		}
    	}
            
    		g.setColor(Color.black);
    		g.drawLine(x1 * pixelSize, y1 * pixelSize, x2 * pixelSize, y2
    				* pixelSize);
    
    	}
    
    


    	void drawCircle(Graphics g,int xCenter , int yCenter , int radius){
                 
    	int x, y=0, r2;
            
            r2 = radius * radius;
            for (x = -radius; x <= radius; x++) {
                y = (int) (Math.sqrt(r2 - x*x) + 0.5);
                putPixel(g, xCenter + x, yCenter + y);
                putPixel(g, xCenter + x, yCenter - y);
            }    
            
    		g.setColor(Color.blue);
    		g.drawOval(xCenter, yCenter, r2, r2);
    	
            }
    
    
  3. In Topic: float left DIV and center in the same row

    Posted 22 Nov 2012

    <head>
    <style>
    #container{
    display:inline-block;
    height:100px;
    margin:0px auto;
    border:1px solid black;
    }
    #div1{
    float:left; width:100px;
    
    }
    #div2{
    float:center; width:100px;
    }
    </style>
    </head>
    <body>
    
    <div id="container">
    <div id="div1">
    <img src="profile.png"/>
    </div>
    <div id="div2">
    <img src="function1.PNG"/>
    <img src="function2.PNG"/>
    <img src="function3.PNG"/>
    
    </div>
    </div>
    </body>
    
    


    inline-block would make "margin:0px" auto not work.
    so I gave the container a height
    and move div1 out of container

    <head>
    <style>
    #container{
    width:400px;
    height:100px;
    margin:0px auto;
    border:1px solid black;
    }
    #div1{
    float:left;
    
    }
    #div2{
    float:left;
    }
    </style>
    </head>
    <body>
    <div id="div1">
    <img src="profile.png"/>
    </div>
    <div id="container">
    
    <div id="div2">
    <img src="function1.PNG"/>
    <img src="function2.PNG"/>
    <img src="function3.PNG"/>
    
    </div>
    </div>
    </body>
    
    
  4. In Topic: Hi,

    Posted 22 Nov 2012

    I can coding html,php,asp,java,c++,javascript

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Rpgmaster has no profile comments yet. Why not say hello?