Jump to content

kama1983

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by kama1983

  1. calculate row 1 + row 2 and add them to final result you can do it

     

    for example :

     

    <?php

    $con = mysql_connect("localhost", "peter", "abc123");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }

     

    $db_selected = mysql_select_db("test_db",$con);

     

    $sql = "SELECT * from Person";

    $result = mysql_query($sql,$con);

     

    while($row = mysql_fetch_array)

    {

    $row1 = $row[0 or name your field];

    $row2 = $row[1 or name your field];

    echo $row1 + $row2;

    }

     

    mysql_close($con);

    ?>

  2. calculate row 1 + row 2 and add them to final result you can do it

     

    for example :

     

    <?php

    $con = mysql_connect("localhost", "peter", "abc123");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }

     

    $db_selected = mysql_select_db("test_db",$con);

     

    $sql = "SELECT * from Person";

    $result = mysql_query($sql,$con);

     

    while($row = mysql_fetch_array)

    {

    $row1 = $row[0 or name your field];

    $row2 = $row[1 or name your field];

    echo $row1 + $row2;

    }

     

    mysql_close($con);

    ?>

×
×
  • Create New...