Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Grab output from echo

    ok this is what i want to do: get all the numbers echoed from the if statements so i can add them up. only i dont know how to grab the echoed data.

    this is what i got, how do i grab it?
    PHP Code:
    <?php
     
    require_once "header.php"
     
    // more content
     
    require_once "footer.php";


    // make connection 
    mysql_connect("localhost""root""moreland") or die('Could not connect'); 
    mysql_select_db("ipool") or die('Could not connect to database'); 

    // build query 
    $q1 mysql_query("SELECT pick5_1, pick5_2,pick6_1 FROM TestTable WHERE ID='3'"); 
    $q1row mysql_fetch_array($q1); 

    $q2 mysql_query("SELECT pick5_1, pick5_2, pick6_1 FROM Official"); 
    $q2row mysql_fetch_array($q2);  


    if (
    $q1row['pick5_1'] == $q2row['pick5_1']) { echo "16";} else { echo "0";}
    if (
    $q1row['pick5_2'] == $q2row['pick5_2']) { echo "16";} else { echo "0";}

    if (
    $q1row['pick6_1'] == $q2row['pick6_1']) { echo "32";} else { echo "0";}

    $first_round all echoed data from round;
    $second_round all echoed data from round;


    $sum_total $first_round $second_round;
    print (
    $sum_total);




    ?>
    thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,855
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    if ($q1row['pick5_1'] == $q2row['pick5_1']) { echo "16";} else { echo "0";}
    if ($q1row['pick5_2'] == $q2row['pick5_2']) { echo "16";} else { echo "0";}

    if ($q1row['pick6_1'] == $q2row['pick6_1']) { echo "32";} else { echo "0";}

    $first_round = all echoed data from round;
    $second_round = all echoed data from round;
    PHP Code:
    if ($q1row['pick5_1'] == $q2row['pick5_1']) { $first_round=16;} else {$first_round=0;}
    .........

    echo 
    $first_round 
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    thilss0o (03-13-2010)

  • #3
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    thanks!


  •  

    Posting Permissions

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