Jump to content

Ken2k7

Members
  • Posts

    5,196
  • Joined

  • Last visited

    Never

Posts posted by Ken2k7

  1. Code behaves differently when it's incorrectly written. The fact it works doesn't mean it's correct. ;)

     

    So no, I don't know. As for the color palette, I'm sure you can add more to it. I haven't looked through your mess to say how though. Post up the relevant bits.

  2. Add single quotes to onclick="showPalette('palette')"

     

    Also, add a check.

    function showPalette(Click_Menu) {
        Click_Menu = document.getElementById(Click_Menu);
        if (!Click_Menu || !Click_Menu.style) return;
        if (Click_Menu.style.display == "none") {
            Click_Menu.style.display = "block";
        } else {
            Click_Menu.style.display = "none";
        }
    }
    

  3. Okay, a few things:

    $csql1="UPDATE 'games' SET counter = '$counter' WHERE gid =  '$gid'";

    Don't put single quote around games. It's a table name, not a string.

     

    $counter=$ccolumn['counter'];

    $ccolumn is not defined.

     

    Also, your code is redundant. Just run:

     

    mysql_query("UPDATE games SET counter = counter + 1 WHERE gid = '$gid';") or trigger_error(mysql_error());

     

    No need for all the checks. That will add 1 to counter.

  4. What difference would that make? You can easily add a new column called "ordering" if you want to order them in a particular order.

     

    You can still do it using UNION. Just select the first 2 in descending order, then UNION it with the rest ordered by descending.

  5. Again, please do not post any code that are not relevant to the problem, like that PHP class file. If I haven't helped you earlier, I would have no idea what that class does or why you posted it. It doesn't help us help you if you post up more code that are not of any relevance.

     

    You shouldn't have JavaScript be a validation to get into a page. It just doesn't work, period.

  6. You can store the values in an array like this:

     

    $a = array(
         'product1'  => array(
              'price' => '5.50',
              'shipping' => '10.40'
         ),
         'product2'  => array(
              'price' => '10.00',
              'shipping' => '.10'
          ),
          ...
    );
    
    // keeps track of the total price
    $price = 0;
    
    // keeps track of the total shipping
    $shipping = 0;
    
    // then loop
    foreach ($a as $key => $value) {
         $price += $value['price'];
         $shipping += $value['shipping'];
    }
    
    echo sprintf("Price: %s<br />Shipping: %s<br />", $price, $shipping);
    

  7. Doesn't make sense because for one, CURRENT_DATE() should be already be greater than last_voted, so adding 12 hours to it doesn't do anything. I think you want to subtract or add 12 hours to last_voted. But your logic is off.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.