Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    OK Show me a row like you said:

    Columns: amount, id, miscdesc

    1: 7.50
    2: 7.50
    3: 7.50

    With three columns? Yet you have 2? Then an example output as in what do you want the code to return to you...
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #12
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    OK Show me a row like you said:

    Columns: amount, id, miscdesc

    1: 7.50
    2: 7.50
    3: 7.50

    With three columns? Yet you have 2? Then an example output as in what do you want the code to return to you...

    I want the code to return me the data of the amount column in a total.

    Example output:

    £7.70
    Last edited by Calon; 05-10-2008 at 08:53 PM.

  3. #13
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Oh.

    Wow. Thats basic.
    PHP Code:
    $amount = array();
    $i 0;
    while(
    $row mysql_fetch_array($query) {
        
    $amount[$i] = str_replace('£, '', $row['amount']); // get the unicode for sterling sign
        ++$i;

    This will create an array of those values.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  4. #14
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Oh.

    Wow. Thats basic.
    PHP Code:
    $amount = array();
    $i 0;
    while(
    $row mysql_fetch_array($query) {
        
    $amount[$i] = str_replace('£, '', $row['amount']); // get the unicode for sterling sign
        ++$i;

    This will create an array of those values.
    Code:
    <?php
    //mysql login code was here lol
    
    $query = mysql_query("SELECT * FROM `money`")
    $amount = array();
    $i = 0;
    while($row = mysql_fetch_array($query) {
        $amount[$i] = str_replace('£, '', $row['amount']); // get the unicode for sterling sign
    }  
    ?>

  5. #15
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Hypertext forgot to indentate!!
    Back for a while.

  6. #16
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Parse error: syntax error, unexpected T_VARIABLE in /home/calonuk/public_html/money.php on line 6

    *Awaits help.*

  7. #17
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    Code:
    <?php
    //mysql login code was here lol
    
    $query = mysql_query("SELECT * FROM `money`")
    $amount = array();
    $i = 0;
    while($row = mysql_fetch_array($query) {
        $amount[$i] = str_replace('£, '', $row['amount']); // get the unicode for sterling sign
    }  
    ?>
    Code:
    <?php
    //mysql login code was here lol
    
    $query = mysql_query("SELECT * FROM `money`")
    $amount = array();
    $i = 0;
    while($row = mysql_fetch_array($query) {
        $amount[$i] = str_replace('£', '', $row['amount']); // get the unicode for sterling sign
    }  
    ?>
    I missed a closing quote. That should work now.
    Quote Originally Posted by Excellent2 View Post
    Hypertext forgot to indentate!!
    GTFO.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  8. #18
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Code:
    <?php
    //mysql login code was here lol
    
    $query = mysql_query("SELECT * FROM `money`")
    $amount = array();
    $i = 0;
    while($row = mysql_fetch_array($query) {
        $amount[$i] = str_replace('£', '', $row['amount']); // get the unicode for sterling sign
    }  
    ?>
    I missed a closing quote. That should work now.


    GTFO.
    PHP Code:
    <?php
    mysql_connect
    'localhost''calonuk_trains''*******' ) or die(mysql_error());
    mysql_select_db'calonuk_website' ) or die(mysql_error());

    $query mysql_query("SELECT * FROM `money`")
    $amount = array();
    $i 0;
    while(
    $row mysql_fetch_array($query) {
        
    $amount[$i] = str_replace('£'''$row['amount']); // get the unicode for sterling sign
    }  

    ?>
    Doesn't seem to be working.

    any table stuff or something? I'm really tired and cant think

  9. #19
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    GTFO.
    Yeah, you don't like it when people hit back at you do you?
    Back for a while.

  10. #20
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent2 View Post
    Yeah, you don't like it when people hit back at you do you?
    Please don't flame.. I really need help and you're not helping.

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
  •