...

View Full Version : Grab output from echo



thilss0o
03-13-2010, 07:16 AM
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
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

abduraooft
03-13-2010, 07:33 AM
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;

if ($q1row['pick5_1'] == $q2row['pick5_1']) { $first_round=16;} else {$first_round=0;}
.........

echo $first_round ;

thilss0o
03-13-2010, 03:39 PM
thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum