Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Mysql help/PHP

  1. #21
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    Gold Dragon

    9T 0 HCVenomous Habbulus

    99.0 HCBlueberry Icm

    89.0 HCStrawberry Icm

    89 HCNavy Pillow

    84 HCValentines Cauldron

    8 HCSaturn Smoke

    79 HCMercury Smoke

    74 HCDirectors Chair

    74 HCAqua Monolith

    7 HCPluto Smoke

    69 HCBronze Dragon

    66 HCTurquoise Pillow

    64 HCPink Pillow

    64 HCNeptune Smoke

    64 HCSkull Guitar

    64 HCBlack Laser Gate

    6.8 HCTypo

    50 HCGold Laser

    5.5 HCVenus Smoke

    48 HCBlack Pillow

    45 HCSky Dragon

    448 HCPink Monolith

    40 HCBlue Sleeping Bag



    Still ordering them wrong

  2. #22
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    I now have them ordering correctly

    i changed the type in sql from varchar to int....which wouldnt let me have decimal places.

    so i set them as decimal and made it 5,1 to allow one decimal

    only problem now is i want to filter out the .0 as its poitnless but to have 0.5 i need the decimal lol

    example:
    www.habtopia.co.uk/values/show_rares.php

  3. #23
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    $value = str_replace(".0", "", $value);

    not looked at your code but yeah.

  4. #24
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    Have tried this seem to do nothing?

    any ideas anybody else

    btw the code is

  5. #25
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by Habtopia View Post
    Have tried this seem to do nothing?

    any ideas anybody else

    btw the code is
    You can't just put it in there you really should learn some bsic php knowledge and if my way was ordering wrong you must have forgotten to put the 0s when you were inserting them.

    PHP Code:
    <?php
    include ("config.php");
    include (
    "opendb.php");
    $get_cats mysql_query"SELECT * FROM `categories` ORDER BY `displayorder`" ) or die( mysql_error() );
    $get_info mysql_query"SELECT * FROM `systeminfo`" ) or die( mysql_error() );
    $info mysql_fetch_array$get_info ); 
    while( 
    $cats mysql_fetch_array$get_cats ) ) {
        
    $get_rares mysql_query"SELECT * FROM `rares` WHERE `catid`='{$cats ['id']}' ORDER BY `value` DESC" ) or die( mysql_error() );
        echo (
    "<b><center><font face=verdana size=1> &nbsp; &nbsp;" $cats ['name'] . "</font></center></b><br>
    <table width=\"466\" border=\"0\">
    "
    );
        
    $color1 $info [stripe1];
        
    $color2 $info [stripe2];
        
    $row_count 0;
        while( 
    $rare mysql_fetch_array$get_rares ) ) {
            
    $row_color = ($row_count 2) ? $color1 $color2;
            
    ?>
    <td>

    <td id="<?php
            
    echo $rare ["id"];
            
    ?>" width="15%" style="text-align:center;background-color:#<?php
            
    echo $row_color;
            
    ?>"><font face=verdana size=1><?php
            
    echo $rare ['name'];
            
    ?></font><br>
    <font face=verdana size=1><img alt=""
        src="<?php
            
    echo ("" $info [imagepath] . "" $rare ['image'] . "");
            
    ?>"><br><?php
            $value 
    $rare ['value'];
            
    $value str_replace(".0"""$value);
            echo 
    $value;
            
    ?> HC</font></td>
    </td>
    <?php
           $row_count 
    ++;
            if(
    $row_count == 6) {
                echo 
    '</tr><tr>'//close and open a row if $row_count=;6
                
    $row_count 0;
            }
        }
        echo (
    "</table><br>
    "
    );
    }
    ?>

  6. #26
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jxhn View Post
    I'm not sure that would work.
    Haha i didn't know what he wanted, but i thought he had the string as OO1HC
    OO20HC etc and he wanted just the 20 HC bit, in which case explode could be used.

  7. #27
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    Jxhn you have been amazing help seriously the .0's are now filtered out

  8. #28
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    i filtered 576 to 8T 8 this shows 576 as 8T 8 HC but doing this for every rare would be time consuming and id have to change them all when throne value changed, is there anyway to grab throne value then so it would change them all into T + HC?

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •