Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Mysql help/PHP

  1. #11
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Is your database storeing the values as integers or strings? (I don't know too much about MySQL so forgive me if that was a silly question).

    EDIT: I think you need to get the script to store them in the database as just numbers and get the php script to convert them to thrones and hcs etc.
    Last edited by Jxhn; 20-12-2008 at 03:30 PM.

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

    Default

    Quote Originally Posted by Jxhn View Post
    Is your database storeing the values as integers or strings? (I don't know too much about MySQL so forgive me if that was a silly question).

    EDIT: I think you need to get the script to store them in the database as just numbers and get the php script to convert them to thrones and hcs etc.

    If i could answer i would lol, do you know how to check

    [I replied the second u edited HA]
    Last edited by Habtopia; 20-12-2008 at 03:33 PM.

  3. #13
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    The only solution I can think of without editing the script is to save the values as 001HCs 015HCs etc, but that would look quite bad.

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

    Default

    Quote Originally Posted by Jxhn View Post
    The only solution I can think of without editing the script is to save the values as 001HCs 015HCs etc, but that would look quite bad.
    Yeah i though of that too but then thougt ud have to filter the '0s' somehow lol

  5. #15
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Habtopia View Post
    Yeah i though of that too but then thougt ud have to filter the '0s' somehow lol
    Lookup explode() , I suppose that could be used. Something like that.

    If you PMed me explaining what u want I would fix.

  6. #16
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by Jackboy View Post
    Lookup explode() , I suppose that could be used. Something like that.

    If you PMed me explaining what u want I would fix.
    I'm not sure that would work. This should:
    PHP Code:
    $value $row['valuesorwe'];
    if(
    substr($value0== "00")
    $value substr($value2);
    else if(
    substr($value0== "0")
    $value substr($value1);
    echo 
    $value
    Still a messy solution. The way they are added to the database should really be changed.

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

    Default

    Quote Originally Posted by Jxhn View Post
    I'm not sure that would work. This should:
    PHP Code:
    $value $row['valuesorwe'];
    if(
    substr($value0== "00")
    $value substr($value2);
    else if(
    substr($value0== "0")
    $value substr($value1);
    echo 
    $value
    Still a messy solution. The way they are added to the database should really be changed.
    where in the script would this be inserted?

  8. #18
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by Habtopia View Post
    where in the script would this be inserted?
    I think the quotes got messed up in the PMs.

    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 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'];
    if(
    substr($value0== "00")
    $value substr($value2);
    else if(
    substr($value0== "0")
    $value substr($value1);
    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>
    "
    );
    }
    ?>

  9. #19
    Join Date
    Nov 2007
    Posts
    182
    Tokens
    0

    Default

    Parse error: syntax error, unexpected T_VARIABLE in /home/habjay/public_html/values/show_rares.php on line 23

  10. #20
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    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 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'];
    if(
    substr($value02) == "00")
    $value substr($value2);
    else if(
    substr($value01) == "0")
    $value substr($value1);
    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>
    "
    );
    }
    ?>

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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